DOTCMS REST API Record Updates

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

DOTCMS REST API Record Updates

Henry Versemann

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

 

    

 

 

 

 

 

 

 

 

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

RE: DOTCMS REST API Record Updates

Nathan Keiter

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

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Henry Versemann
Sent: Monday, October 16, 2017 5:37 PM
To: '[hidden email]'
Subject: [dotcms] DOTCMS REST API Record Updates

 

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

 

    

 

 

 

 

 

 

 

 

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/680a5193a3764642be753cd81f83de16%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: DOTCMS REST API Record Updates

Henry Versemann

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

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Nathan Keiter
Sent: Monday, October 16, 2017 4:40 PM
To: [hidden email]
Subject: [dotcms] RE: DOTCMS REST API Record Updates

 

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

 

From: [hidden email] [[hidden email]] On Behalf Of Henry Versemann
Sent: Monday, October 16, 2017 5:37 PM
To: '[hidden email]'
Subject: [dotcms] DOTCMS REST API Record Updates

 

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

 

    

 

 

 

 

 

 

 

 

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/680a5193a3764642be753cd81f83de16%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/BLUPR0501MB1700147FF569C5449B5EB934AD4C0%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.