As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Hi guy , I apologize I am really alfresco newbie. I try to update file properties with REST API. But allways I lost all version history. I cannot find any parametr in swagger which can help me.
With the info you have shared, it could be possible that you are not using the APIs properly and somehow cm:versiobable aspect is getting removed. Could you check whether cm:versionable aspect is present on the document where you are seeing this issue? you can use node browser to check that or use below api call with nodeRefId param:
This would return a list of aspects in the response, you can check cm:versionable aspect presence: http://127.0.0.1:8080/alfresco/service/api/metadata?nodeRef=workspace://SpacesStore/902413b5-b3ed-4a88-afed-6b44f88a78d5
Also can you make sure there are no change to following properties, these are default settings:
# ADM VersionStore Configuration version.store.initialVersion=true version.store.enableAutoVersioning=true version.store.enableAutoVersionOnUpdateProps=false
If you want a new version to be created on update of one/more properties, you can enable it in alfresco-global.properties:
version.store.enableAutoVersionOnUpdateProps=true
To understand more on how these properties work, refer this post: https://hub.alfresco.com/t5/alfresco-content-services-forum/version-history-does-not-include-property-updates/m-p/297112/highlight/true#M18250
Have a look at these V1 REST APIs:
To upload a file: https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-upload-file.html
To upload a new version of a file: https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-upload-file-new-version.html
To update the properties: https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-update-node-metadata.html
Just follow the instructions and try the sample URLs as provided to under the working of APIs.
All file/folder management APIs can be found here: https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-mng-folders-files.html