Alfresco Rest API how can i force to show the "sys:xxx" properties on the api response ?

cancel
Showing results for 
Search instead for 
Did you mean: 
4535992
Senior Member

Alfresco Rest API how can i force to show the "sys:xxx" properties on the api response ?

Jump to solution

I'm using the alfresco community version 7.4.0 and postman with a basic authentication.

Here the get call :

http://www.mysite.com/alfresco/api/-default-/public/alfresco/versions/1/sites/mysite01/members

here the response:

{
    "list": {
        "pagination": {
            "count": 6,
            "hasMoreItems": false,
            "totalItems": 6,
            "skipCount": 0,
            "maxItems": 100
        },
        "entries": [
            {
                "entry": {
                    "role": "SiteManager",
                    "person": {
                        "aspectNames": [
                            "myns:myaspect",
                           "sys:referenceable"   // i want to see here 'sys:referenceable' if it is possible
                        ],
                        "firstName": "TestUSE01",
                        "capabilities": {
                            "isGuest": false,
                            "isAdmin": false,
                            "isMutable": true
                        },
                        "displayName": "TestUSE01",
                        "emailNotificationsEnabled": true,
                        "company": {},
                        "id": "TestUSE01",
                        "enabled": true,
                        "email": "test@gmail.com",
                        "properties": {
                           myns:property1,
                            myns:property2,
                           sys:node-uuid // i want to see here 'sys:node-uuid' if it is possible
                          ...
                        }
                    },
                    "id": "TestUSE01",
                    "isMemberOfGroup": false
                }
            },
          ....
        ]
    }
}

i want to see the property 'sys:node-uuid' on the rest api response if it is possible.

How can i "force" alfresco to show the sys:referenceable aspect ?

 

1 Solution

Accepted Solutions
angelborroy
Alfresco Employee

Re: Alfresco Rest API how can i force to show the "sys:xxx" properties on the api respons

Jump to solution

The REST API is hidding intentionally internal details, so there is no way to expose the sys:referenceable aspect.

Alternatively, you can use the Search API in this way:

curl --location 'http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--data '{
  "query": {
    "query": "PATH:\"/sys:system/sys:authorities/cm:GROUP_site_swsdp//*\""
  }
}'

Where "swsdp" is the id of your site.

Results are including the "id" of the members:

{
    "list": {
        "pagination": {
            "count": 9,
            "hasMoreItems": false,
            "totalItems": 9,
            "skipCount": 0,
            "maxItems": 100
        },
        "context": {
            "consistency": {
                "lastTxId": 20
            }
        },
        "entries": [
            {
                "entry": {
                    "isFile": true,
                    "createdByUser": {
                        "id": "abeecher",
                        "displayName": "Alice Beecher"
                    },
                    "modifiedAt": "2015-09-29T10:45:15.729+0000",
                    "nodeType": "cm:content",
                    "content": {
                        "mimeType": "image/jpeg",
                        "mimeTypeName": "JPEG Image",
                        "sizeInBytes": 2347,
                        "encoding": "UTF-8"
                    },
                    "parentId": "dc103838-645f-43c1-8a2a-bc187e13c343",
                    "createdAt": "2015-09-29T10:45:15.729+0000",
                    "isFolder": false,
                    "search": {
                        "score": 0.0
                    },
                    "modifiedByUser": {
                        "id": "abeecher",
                        "displayName": "Alice Beecher"
                    },
                    "name": "abeecher-avatar.jpg",
                    "location": "nodes",
                    "id": "d65a4795-578e-4780-9f27-96ce43bde700"
                }
            }
Hyland Developer Evangelist

View solution in original post

3 Replies
4535992
Senior Member

Re: Alfresco Rest API how can i force to show the "sys:xxx" properties on the api respons

Jump to solution

Forgive me @angelborroy I generally don't ping people directly, but I would like to get answer on this question, Even a simple "you can't"

angelborroy
Alfresco Employee

Re: Alfresco Rest API how can i force to show the "sys:xxx" properties on the api respons

Jump to solution

The REST API is hidding intentionally internal details, so there is no way to expose the sys:referenceable aspect.

Alternatively, you can use the Search API in this way:

curl --location 'http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--data '{
  "query": {
    "query": "PATH:\"/sys:system/sys:authorities/cm:GROUP_site_swsdp//*\""
  }
}'

Where "swsdp" is the id of your site.

Results are including the "id" of the members:

{
    "list": {
        "pagination": {
            "count": 9,
            "hasMoreItems": false,
            "totalItems": 9,
            "skipCount": 0,
            "maxItems": 100
        },
        "context": {
            "consistency": {
                "lastTxId": 20
            }
        },
        "entries": [
            {
                "entry": {
                    "isFile": true,
                    "createdByUser": {
                        "id": "abeecher",
                        "displayName": "Alice Beecher"
                    },
                    "modifiedAt": "2015-09-29T10:45:15.729+0000",
                    "nodeType": "cm:content",
                    "content": {
                        "mimeType": "image/jpeg",
                        "mimeTypeName": "JPEG Image",
                        "sizeInBytes": 2347,
                        "encoding": "UTF-8"
                    },
                    "parentId": "dc103838-645f-43c1-8a2a-bc187e13c343",
                    "createdAt": "2015-09-29T10:45:15.729+0000",
                    "isFolder": false,
                    "search": {
                        "score": 0.0
                    },
                    "modifiedByUser": {
                        "id": "abeecher",
                        "displayName": "Alice Beecher"
                    },
                    "name": "abeecher-avatar.jpg",
                    "location": "nodes",
                    "id": "d65a4795-578e-4780-9f27-96ce43bde700"
                }
            }
Hyland Developer Evangelist
4535992
Senior Member

Re: Alfresco Rest API how can i force to show the "sys:xxx" properties on the api respons

Jump to solution

thank you and sorry for the trouble