AnsweredAssumed Answered

How to get site id of a node using REST API ?

Question asked by mikeitexpert on May 29, 2018
Latest reply on May 29, 2018 by jpotts

Hi All,

 

I would like to get site name / id of a given node id. How can I do that?

 

I used the below query (/nodes/{nodeId}/parents) but apparently it gives only the immediate parent of the node?

 

Request

http://127.0.0.1:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/b5c8f4ec-e7e2-4e74-81cd-d1e00c4a0258/parents?skipCount=0&maxItems=100

 

Response

{
   "list":{
      "pagination":{
         "count":1,
         "hasMoreItems":false,
         "totalItems":1,
         "skipCount":0,
         "maxItems":100
      },
      "entries":[
         {
            "entry":{
               "createdAt":"2018-05-28T17:40:02.421+0000",
               "isFolder":true,
               "isFile":false,
               "createdByUser":{
                  "id":"admin",
                  "displayName":"Administrator"
               },
               "modifiedAt":"2018-05-28T23:55:58.705+0000",
               "modifiedByUser":{
                  "id":"admin",
                  "displayName":"Administrator"
               },
               "name":"MyFolder1",
               "association":{
                  "isPrimary":true,
                  "assocType":"cm:contains"
               },
               "id":"7bd86fea-5477-470f-9d91-2c7937a8936e",
               "nodeType":"cm:folder",
               "parentId":"18f734ac-8e2c-424b-a75c-c19db3ea6d36"
            }
         }
      ]
   }
}

Please let me know

Thank you,

 

Edit by Axel Faust: Use syntax highlighter and formatting to make post easier to read.

Outcomes