Dear Team,
I need a api for display an document from site.
i have reffered the below api -
http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/{id}/renditions/{renditionId}/content
but i am not understood how to get renditionid of document.
Kinldy suggest!
Thank you.
Kind regards,
Aishu.
You get the IDs of renditions by first querying the listRenditions API (.../nodes/{id}/renditions)
dear afaust,
i have refered this link,
as per api the document in the form of pdf so i have mentioned renditionid = pdf.
but its showing below error
{"error":{"errorKey":"pdf is not applicable for the node's mimeType application/pdf","statusCode":404,"briefSummary":"0623809817 pdf is not applicable for the node's mimeType application/pdf","stackTrace":"For security reasons the stack trace is no longer displayed, but the property is kept for previous versions","descriptionURL":"https://api-explorer.alfresco.com"}}
kindly suggest on this.
i have tried the api for renderation content-
but its showing below error-
{"error":{"errorKey":"Thumbnail was not found for [pdf]","statusCode":404,"briefSummary":"0623812230 Thumbnail was not found for [pdf]","stackTrace":"For security reasons the stack trace is no longer displayed, but the property is kept for previous versions","descriptionURL":"https://api-explorer.alfresco.com"}}
kindly suggest!
Thank you.
Hi @aishu
I think you may need to check which renditions are available for your nodeID, pick the renditionID you want (if status=CREATED) or request it (if status=NOT_CREATED), and finally get the rendition content using the nodeID and renditionID.
Back to your original question: you'll find the renditionID in the response from List Renditions as @afaust mentioned.
So in the Response Body snippet below, avatar, doclib, imgpreview and pdf are valid parameters.
{ "list": { "pagination": { "count": 7, "hasMoreItems": false, "totalItems": 7, "skipCount": 0, "maxItems": 100 }, "entries": [ { "entry": { "id": "avatar", "content": { "mimeType": "image/png", "mimeTypeName": "PNG Image", "sizeInBytes": 1387, "encoding": "UTF-8" }, "status": "CREATED" } }, ... { "entry": { "id": "doclib", "content": { "mimeType": "image/png", "mimeTypeName": "PNG Image", "sizeInBytes": 2388, "encoding": "UTF-8" }, "status": "CREATED" } }, { "entry": { "id": "imgpreview", "content": { "mimeType": "image/jpeg", "mimeTypeName": "JPEG Image" }, "status": "NOT_CREATED" } }, ... { "entry": { "id": "pdf", "content": { "mimeType": "application/pdf", "mimeTypeName": "Adobe PDF Document", "sizeInBytes": 22800, "encoding": "UTF-8" }, "status": "CREATED" } }, ... ] } }
Note: I cropped out three renditions in the above response.
HTH
Hi @aishu
I think you may need to check which renditions are available for your nodeID, pick the renditionID you want (if status=CREATED) or request it (if status=NOT_CREATED), and finally get the rendition content using the nodeID and renditionID.
Back to your original question: you'll find the renditionID in the response from 'listRenditions' as mentioned by @afaust.
So in the Response Body snippet below, avatar, doclib, imgpreview and pdf are valid parameters.
{ "list": { "pagination": { "count": 7, "hasMoreItems": false, "totalItems": 7, "skipCount": 0, "maxItems": 100 }, "entries": [ { "entry": { "id": "avatar", "content": { "mimeType": "image/png", "mimeTypeName": "PNG Image", "sizeInBytes": 1387, "encoding": "UTF-8" }, "status": "CREATED" } }, { "entry": { "id": "doclib", "content": { "mimeType": "image/png", "mimeTypeName": "PNG Image", "sizeInBytes": 2388, "encoding": "UTF-8" }, "status": "CREATED" } }, { "entry": { "id": "imgpreview", "content": { "mimeType": "image/jpeg", "mimeTypeName": "JPEG Image" }, "status": "NOT_CREATED" } }, { "entry": { "id": "pdf", "content": { "mimeType": "application/pdf", "mimeTypeName": "Adobe PDF Document", "sizeInBytes": 22800, "encoding": "UTF-8" }, "status": "CREATED" } }, ] } }
Note: I cropped out three renditions in the above response.
HTH
Dear adelaidenx
I have tried for get renditions using api- get /nodes/{nodeId}/renditions
but unable to get correct output.its not showing entries.
kindly suggest!
{"list":{"pagination":{"count":0,"hasMoreItems":false,"totalItems":0,"skipCount":0,"maxItems":100},"entries":[]}}
thank you.
Regards,
Aishu.
Hi @aishu
What response message (HTTP status code) are you getting?
These codes are documented in the List renditions: REST API Explorer.
hi @adelaidenx ,
i have followed same codes mentioned in List renditions: REST API Explorer..
but no data or content present in entries- response header.
refer attached image.
Hi @aishu
So it looks like no renditions are listed for that node where status=CREATED.
What happens if you remove the status in the url?
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.