07-23-2020 03:46 AM
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.
07-23-2020 04:14 AM
You get the IDs of renditions by first querying the listRenditions API (.../nodes/{id}/renditions)
07-23-2020 05:54 AM
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.
07-23-2020 06:04 AM
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.
07-23-2020 11:05 AM
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
07-23-2020 11:32 AM
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
07-24-2020 01:57 AM
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.
07-24-2020 04:48 AM
Hi @aishu
What response message (HTTP status code) are you getting?
These codes are documented in the List renditions: REST API Explorer.
07-24-2020 05:00 AM
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.
07-24-2020 08:05 AM
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?
Explore our Alfresco products with the links below. Use labels to filter content by product module.