Get File Rendition Content - Alfresco Content Services - 23.4 - 23.4 - Ready - Alfresco - external

Alfresco Content Services

Platform
Alfresco
Product
Alfresco Content Services
Release
23.4
License

Get the rendition file content, if it has been generated.

API Explorer URL: http://localhost:8080/api-explorer/#!/renditions/getRenditionContent

If you know that a file has a rendition you can retrieve the content for it with the following HTTP GET call: http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/{id}/renditions/{renditionId}/content

Here we are getting the rendition content for the rendition specified with {renditionId} for the file with Node Identifier specified as the {id} URL part.

The following example gets the doclib rendition (i.e. the thumbnail) content for a text file with the d8f561cc-e208-4c63-a316-1ea3d3a4e10e Node Identifier and stores it in a local file called somerendition.png:

$ curl -X GET --output somerendition.png -H 'Accept: image/png' -H 'Authorization: Basic VElDS0VUXzA4ZWI3ZTJlMmMxNzk2NGNhNTFmMGYzMzE4NmNjMmZjOWQ1NmQ1OTM=' 'http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/d8f561cc-e208-4c63-a316-1ea3d3a4e10e/renditions/doclib/content'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   432  100   432    0     0  19636      0 --:--:-- --:--:-- --:--:-- 19636
Note: HTTP 412 status is returned when requested content is in Cloud Storage and is offline (not immediately accessible). In such a case, to retrieve content, a request to restore content (see Restore File from Archive) from offline state needs to be submitted.