DOTCMS REST API Record Updates

8 views
Skip to first unread message

Henry Versemann

unread,
Oct 16, 2017, 5:36:58 PM10/16/17
to dot...@googlegroups.com

I have the following json string with my update information (for my REST API request) in it to update a record that I previously added the record through the REST API:

 

$employeeUpdateValues = { "title": "professor",

                                                  "stName": "Employees",

                                                  "identifier": "dec3abf9-d0c2-4084-8d04-61ff3ea73755",

                                                  "Department-Employees": "+identifier: c3829700-3f84-4077-9743-a3463a7f5050" }

 

And I have run the object through JSONLint just to make sure its in valid json format.

 

In the request that I’m sending to the REST API I want to update the entry represented by the “identifier” value (the original record added) in the object located in the structure specified by the “stName” key’s value.

Specifically I want to update the value in the “title” field of that entry and then I also want to assign a department relationship for the employee as indicated by the “Department-Employees” key value to the department indicated by the “+identifier: c3829700-3f84-4077-9743-a3463a7f5050”.

 

My title update seems to work ok and I can see that that value of the entry’s title field has changed to match the value shown in the json object, but the relationship update never seems to happen, even though I still seem to get back a status code of 200, in response to the request. Since the relationship assignment update does not seem to be happening, I’m kind of surprised that I still get a status code of 200.

 

Not sure exactly what’s going on , but I was hoping to do the relationship update at the same time as I do the “title” field update.

 

So do I need to do them separately?

 

Thanks for looking.

 

Henry

 

    

 

 

 

 

 

 

 

 

Nathan Keiter

unread,
Oct 16, 2017, 5:40:08 PM10/16/17
to dot...@googlegroups.com

I don’t think that’s valid…

 

"Department-Employees": "+identifier: c3829700-3f84-4077-9743-a3463a7f5050"

 

Try:

 

"Department-Employees": "c3829700-3f84-4077-9743-a3463a7f5050"

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB17006F3B0EB54391348CCF02AD4F0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

Henry Versemann

unread,
Oct 17, 2017, 9:32:35 AM10/17/17
to dot...@googlegroups.com

Nathan,

 

Tried making that change with the new $employeeUpdateValues JSON object looking like this:

 

{

                "title": "professor",

                "stName": "Employees",

                "identifier": "c3e68442-e16d-401b-b45c-08de6df80ba3",

                "Department-Employees": "c3829700-3f84-4077-9743-a3463a7f5050"

}

 

The title field was updated successfully as before and again I also got a status code of 200, but the relationship update again did not happen for some reason.

I’m going to try it again without the title field update and see what happens.

 

Thanks for the help.

 

Henry

Reply all
Reply to author
Forward
0 new messages