11-09-2021 12:19 PM
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 }
}
11-10-2021 03:58 AM
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"
}
}'
Explore our Alfresco products with the links below. Use labels to filter content by product module.