Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

adding an entity to a collection fails with dps2015 services php api

Avatar

Avatar
Validate 1
Level 1
tomm15769932
Level 1

Likes

2 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
tomm15769932
Level 1

Likes

2 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
tomm15769932
Level 1

22-12-2015

hello,

we habe some problems with the php-api.

trying to add an article-entity to a collection ( or a collection to the home-collection ) will always fail with the message:

'content-json {"code":"JsonMappingException","message":"JsonMappingException"}'

the message is thrown within the method dps2015sdk\contentService\Article()->updateContentElements();

it seems that the concatenated data ( $arrData ) will not meet the requested data-schema in the server-request.

$articleObj = new dps2015sdk\contentService\Article($oDpsUser);  ok

$articleObj->setEntityName("xyz");  ok

$articleObj->requestMetadata();  ok

$collObj->addEntity($articleObj);  ok

$collObj->requestMetadata();  ok

$collObj->requestContentElements(); ok

$collObj->updateContentElements();  fails

thanks

tom

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Employee
mikecyang
Employee

Likes

10 likes

Total Posts

54 posts

Correct Reply

23 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 5
View profile

Avatar
Boost 5
Employee
mikecyang
Employee

Likes

10 likes

Total Posts

54 posts

Correct Reply

23 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 5
View profile
mikecyang
Employee

22-12-2015

Hi,

dps2015sdk\contentService\Collection::addEntity() requires an entity HREF, please try replacing your line #4 with the following:

$collObj->addEntity($articleObj->getHref());

Please let me know if this doesn't solve the issue.

Best,

Mike

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 1
tomm15769932
Level 1

Likes

2 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
tomm15769932
Level 1

Likes

2 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
tomm15769932
Level 1

23-12-2015

thank you very much.

this solves the issue.