3

I want to use the Afresco REST API to download a document. After some research I find out this REST API:

/alfresco/s/api/node/content{property}/{store_type}/{store_id}/{id}

But I am not sure how to pass the parameters.

If my document details URL in Share is :

http://127.0.0.1:8080/share/page/context/mine/document-details?nodeRef=workspace://SpacesStore/7f77488a-60a0-48c3-9369-77183ccad0d2 

What should be passed in {property}, {store_type}, {store_id} and {id}?

Ali Nawab
  • 85
  • 1
  • 8

2 Answers2

6

For this NodeRef

workspace://SpacesStore/7f77488a-60a0-48c3-9369-77183ccad0d2

the values for parameter will be:

{property}: content
{store_type}: Workspace
{store_id}: spaceStore
{id}: 7f77488a-60a0-48c3-9369-77183ccad0d2 

Details related to each parameter is already specified by Krutik.

And you should use this download url.

/alfresco/d/<d|a>/<workspace>/<store>/<nodeId>/<filename>

where d=direct and a=attached.

The attach or direct element is used to indicate whether to display the stream directly in the browser or download it as a file attachment.

mitpatoliya
  • 2,037
  • 12
  • 23
  • Thanks for your response. I tried http://127.0.0.1:8080/alfresco/s/api/node/content/workspace/SpacesStore/19c6ddf6-afce-4afc-8d3d-b97054deb612 and it works – Ali Nawab Jun 24 '15 at 07:19
2

You can find details of every web-script (REST API) in alfresco on below URL.

http://localhost:8080/alfresco/service/index

For your API it is given as below.

http://localhost:8080/alfresco/service/script/org/alfresco/cmis/content.get

Description of parameter is as below.

Property   : Name of property which you want to retrieve.
store_type : Workspace Protocol
store_id   : Store Id of node
id         : Id of node.
Krutik Jayswal
  • 3,165
  • 1
  • 15
  • 38
  • Thanks...I tried http://127.0.0.1:8080/alfresco/s/api/node/content/workspace/SpacesStore/19c6ddf6-afce-4afc-8d3d-b97054deb612 and it works – Ali Nawab Jun 24 '15 at 07:19