Save relationships between content types using REST API

9 views
Skip to first unread message

mvelasco

unread,
Dec 13, 2017, 7:35:04 AM12/13/17
to dotCMS User Group
Question
I have two content types and a relationship 1: N
Content types:  Promotion (parent), Version (child)
Relationship Promotion-Version

I didn't have any problem saving "Versions" but every time I save a Promotion I lost all previous relationships with Versions. 
As documentation says https://dotcms.com/docs/latest/save-content-using-the-rest-api "When updating content using the REST API, you must submit all relationships for a piece of content each time you update the content."

I tried with:

  1. {
    1. Promotion-Version:"+identifier:(11f3a625-ec65-4414-9c97-84e8e6dc8ede && 35f3ed74-06f2-4463-a4e9-a37823008c9a)"
    2. acquisitionoffer:"True"
    3. domain:"domain-1"
    4. id:"Test 1.3"
    5. identifier:"76df92aa-a443-41bd-9818-8afddbe860c6"
    6. stInode:"c9cebf62-a542-4197-8f7d-55e004ab8393"
    7. type:"Casino"
 }

11f3a625-ec65-4414-9c97-84e8e6dc8ede and 35f3ed74-06f2-4463-a4e9-a37823008c9a are two version of promotion 76df92aa-a443-41bd-9818-8afddbe860c6 But this didn't work.


Reply all
Reply to author
Forward
0 new messages