05-25-2017 04:16 PM
Hello,
I am trying to find the APIs to establish the relationships between records. There is a way to do it through the Alfresco web interface (Creating relationships between records | Alfresco Documentation ) , but I am having trouble finding the correct way to do it through the APIs. I tried the apache opencmis (Apache Chemistry - OpenCMIS Client API Developer's Guide ) to set the relationships but it is not showing that the two documents having established relationships in the Alfresco web interface.
Any help appreciated.
Thanks
05-26-2017 01:30 PM
I figured it out by looking into the chrome developer tools and searching for the POST API that is called when the relationship is created. For those who want to know I used the following API to do the job:
API links:
http://10.5.1.128:8080/alfresco/service/index/uri/
API to use:
POST: alfresco/service/api/node/workspace/SpacesStore/085f4637-bbXXXXXX-74f350920c25/customreferences
Payload:
{
"nodeRef":"workspace://SpacesStore/085f46XXXXX920c25",
"refId":"e5f1f6aXXXX746e55",
"toNode":"workspace://SpacesStore/49a167f7XXXXXa-c751b570db77",
"nodeRefUrl":"workspace/SpacesStore/085f4637-bbe1XXXX4f350920c25",
"successMessage":"Successfully added relationship"
}
05-27-2017 05:38 AM
Maybe this helps:
Working With Custom Content Types in Alfresco | ECMArchitect | Alfresco Developer Tutorials
Regards.
--C.
Explore our Alfresco products with the links below. Use labels to filter content by product module.