I want to retrieve content of sample.html inside catalog folder in alfresco using restful.
From alfresco document i got the following rest url to retrieve content of a document. But i dont know exactly what is property, stor_type
, store_id
,id
and attach
.
GET /alfresco/service/api/node/content{property}/{store_type}/{store_id}/{id}?a={attach?}
It would be grateful if someone explains me the above rest url properties and provide me a example.
The CMIS Web Scripts Reference and the Repository RESTful API Reference give a little more information (but no examples).
property
is the property of the node to follow in order to obtain the content - this will default to cm:content
so can generally be omittedstore_type
will normally be "workspace" for live application data - see this forum discussion on store types etcstore_id
will be "SpacesStore" for normal files - see this forum discussion on other storesid
is the unique identifier for the node (within a given store), e.g. 986b162e-0867-4a7b-9f4f-0e3837cdc97b
attach
- if true, force download of content as attachment (defaults to false) - I think this is to trigger "Save as..." in a browser rather than directly streaming the content?Example GET URL (untested - and of course you'd need to use a valid host, port and id
)
http://my.example.com:8080/alfresco/service/api/node/content/workspace/SpacesStore/986b162e-0867-4a7b-9f4f-0e3837cdc97b
Together, the store_type
, store_id
and id
form a NodeRef
which uniquely identifies a node, e.g.
workspace://SpacesStore/f1a5e908-80cb-4c6e-b919-cc80fe53b835
There are a couple of examples (though not of this exact API call) on Jeff Potts' tutorial on Curl and web scripts.
If you want to download a file by name and path (without already knowing the node ID) then you will need to use another API, as the one you are using requires you to know the node ID.
This page mentions a direct download URL that accepts a path and filename, e.g.
/alfresco/download/direct?path=/Company%20Home/My%20Home%20Space/myimage.jpg
Depending on access controls, you may need to add the login ticket parameter to this URL, e.g. &alf_ticket=1234567890
, where 1234567890
is the security ticket provided by the login URL.
Note: although I refer to the CMIS Web Scripts Reference above, see also this posting and Jira ticket that state that CMIS web script URLs are deprecated, i.e. ( /alfresco/service/cmis
and /alfresco/cmis
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With