DOTCMS REST API - Enterprise Professional v. 3.7.1

3 views
Skip to first unread message

Henry Versemann

unread,
Oct 13, 2017, 11:55:46 AM10/13/17
to dot...@googlegroups.com

I have succeeded in being able to both add and update entries into a structure using the REST API.

 

Now if possible I’d also like to set a relationship for the new entry, as part of the update process.

 

According to the documentation I should be able to do that, first by specifying the relationship name as in my case Departments-Employees, but then according to the documentation I also need to include an identifier as the value associated with the relationship name.

 

I don’t think the documentation explicitly says where the identifier comes from or what it represents. So does the identifier represent the department to be associated with the employee or something else?

 

If so then how in the backend do I find the identifier for the department I’m trying to associate the employee to?

 

Thanks for the help.

 

Henry

Nathan Keiter

unread,
Oct 13, 2017, 12:01:14 PM10/13/17
to dot...@googlegroups.com

It would be the identifier of the content you want to relate.

 

You can find the identifier on the “history” tab of the content edit screen.

 

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/BLUPR0501MB1700BEC376AF4D45EB748959AD480%40BLUPR0501MB1700.namprd05.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

Henry Versemann

unread,
Oct 13, 2017, 12:05:01 PM10/13/17
to dot...@googlegroups.com

Nathan,

 

So if I’m updating a new employee and associating them with a new department then I would go into the history tab of the particular department to be associated with the employee and find the identifier for the department there.

Right?

 

Thanks.

 

Henry

Nathan Keiter

unread,
Oct 13, 2017, 1:30:52 PM10/13/17
to dot...@googlegroups.com

Yes correct.

 

Also, programmatically, you could do a RESTful pull of all departments with the rest API and do a name match and get the identifier, then do your post. Or, since they probably don’t change often, store them on the machine that does the post.

Henry Versemann

unread,
Oct 13, 2017, 1:38:08 PM10/13/17
to dot...@googlegroups.com

Nathan,

 

Glad you anticipated one of my next  question, because I was going to ask something similar about the departments.

 

I anticipate eventually having an input file with a new department name formatted in each entry which I would then use to get the identifier with for relationship update purposes.   

 

Thanks a bunch for all the help.

Reply all
Reply to author
Forward
0 new messages