cancel
Showing results for 
Search instead for 
Did you mean: 

APIs to establish the relationships between records

yuwangbah
Champ in-the-making
Champ in-the-making

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 establishing relationships in the Alfresco web interface.

Any help appreciated.

Thanks

1 REPLY 1

yuwangbah
Champ in-the-making
Champ in-the-making

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"
}

http://10.5.1.128:8080/alfresco/service/index/uri/