cancel
Showing results for 
Search instead for 
Did you mean: 

REST API to get content of a specific version of a file

anant
Champ in-the-making
Champ in-the-making

Hi,

Is there any REST API which returns the content of a specific version of a file? I am using /alfresco/service/api/node/content/workspace/SpacesStore/<id> API to get the content of the latest version, but didnt find any API which returns content for only a specific version which might not be latest.

For example if a file has 2 version 1.0 and 1.1, i want to get the content of 1.0 version file.

Thanks in advance.

6 REPLIES 6

kaynezhang
World-Class Innovator
World-Class Innovator

afaust
Legendary Innovator
Legendary Innovator

Please note that this ReST API is currently only supported against an Alfresco 5.2 EA installation. A GA release of Alfresco 5.2 may occur this month.

If you want to access an older version of Alfresco you should check the URL index for internal ReST APIs via /alfresco/service/index for an appropriate operation.

anant
Champ in-the-making
Champ in-the-making

Thanks Kayne for your reply.

Tried with the APIs mentioned in the post, but didnt work. Not sure if they are available for the version that i am using, i.e 5.0d community version.

Got the below output:

REST URL: http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/c9bc6b23-8673-47ec-b3a... 

OR: http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/workspace/SpacesStore/... 

Output (removed stack trace): 

{
"error": {
"errorKey": "Unable to locate resource resource for :nodes versions",
"statusCode": 400,
"briefSummary": "11130009 Unable to locate resource resource for :nodes versions",
"descriptionURL": "http://developer.alfresco.com/ErrorsExplained.html#Unable to locate resource resource for :nodes versions"
}
}

Am i doing something wrong?

I tried some service API URLs by appending version information to them, but it seems they always return the latest version irrespective of the version that is mentioned in the request

REST URL: http://localhost:8080/alfresco/service/api/node/content/workspace/SpacesStore/c9bc6b23-8673-47ec-b3a... 

kaynezhang
World-Class Innovator
World-Class Innovator

I'm sorry ,as Axel Faust said your version  5.0d  might not support this restful api,.

Can you try to use apache chemistry opencmis library or customize your own webscript api.

anant
Champ in-the-making
Champ in-the-making

Thanks Kayne.

Is there any CMIS API that i can use for this purpose? Trying to browse thru the documentation but didnt find anything yet.

kaynezhang
World-Class Innovator
World-Class Innovator