Alfresco REST API can't update residual properties

cancel
Showing results for 
Search instead for 
Did you mean: 
sherwinf
Active Member

Alfresco REST API can't update residual properties

I'm running into an issue with the REST API where it appears it can view, but not update residual properties. I have a residual property app:counterValue on a node in my repository:

{
    "entry": {
        "aspectNames": [
            "cm:auditable"
        ],
        "modifiedAt": "2021-09-21T19:36:17.340+0000",
        "modifiedByUser": {
            "id": "System",
            "displayName": "System"
        },
        "name": "NOTE_COUNTER",
        "id": "8f8f37d8-2566-45bf-acc8-a5ee471dff17",
        "nodeType": "cm:content",
        "properties": {
            "app:counterValue": 100016
        },
        "parentId": "f5280d70-6ed7-49f0-927c-63ed702bb21c"
    }
}

If I try to update the property using the REST API I get an "Unknown property: app:counterValue". I tried without the prefix and get the same thing. Is there any way around this other than using a custom webscript?

This is my update request:

PUT 'http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/8f8f37d8-2566-45bf-acc8-a5ee471dff17?include=properties&fields=id,name'
{
    "properties": { "app:counterValue": 100017 }
}
1 Reply
angelborroy
Alfresco Employee

Re: Alfresco REST API can't update residual properties

You may try using the legacy REST API.

To update a residual property, use a call similar to the following one.

curl --location --request POST 'http://127.0.0.1:8080/alfresco/s/api/metadata/node/workspace/SpacesStore/cbcb93fd-5c24-4468-9433-c0f68e1a19c5' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--header 'Content-Type: application/json' \
--data-raw '{
    "properties" : {
      "app:counterValue": "2"
    }
}'
Hyland Developer Evangelist