As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
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.
https://alfrescosite-domain name/alfresco/api/-default-/public/alfresco/versions/1/nodes/3268c9f0-1473-4913-8f21-ad8ca7f567f4/renditions/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-
https://----.com/alfresco/api/-default-/public/alfresco/versions/1/nodes/3268c9f0-1473-4913-8f21-ad8ca7f567f4/renditions/pdf/content?attachment=false&placeholder=false
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!
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
Back to your original question: you'll find the renditionID in the response from 'listRenditions' as mentioned by @afaust.
{ "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" } }, ] } }
Hii @aishu
You can use out-of-the-box API for Get Content :
/alfresco/s/api/node/content/{store_type}/{store_id}/{id}?a={attach?} which will gets the content stream of specified document.
where store_type=workspace,store_id=SpacesStore
id is node_uuid of document that you want. and a is boolean parameter if a=true then it will download your content and if a=false then if document is pdf or image you can see preview of that document on browser.
Hi @harsh_thakkar ,
Thank you for your response.
we are trying to capture view share public link without authentication.
example- http://alfresco.domain.com:---/share/s/lkZtI9VIQOmelK9--EmFJg
could you please sugegst us how can we get this document/node ref id from database using query.
Thank you!
Kind Regards,
Aishu
Hello @aishu
For view share public link you need to share that document so later you can get sharable link as you showed.
So for creating shared link you need to call API which will give you sharedId and after that you can add that sharedId in the format http://alfresco.domain.com:---/share/s/{sharedId} to access view without authentication.
For creating shared link please refer https://api-explorer.alfresco.com/api-explorer/#!/shared-links/createSharedLink .
In this API you need to pass nodeId of node that you want to view share public link and in response you will get sharedId.
Or you can also use following API which also returns sharedId and take parameters for particular node.
POST /alfresco/s/api/internal/shared/share/{store_protocol}/{store_id}/{node_id}
Dear @harsh_thakkar,
Thanks for the response.
I have tried the api as you have mentioned in the previous mail.
http://alfresco.domain.com/alfresco/api/-default-/public/alfresco/versions/1/shared-links?skipCount=0&maxItems=1000
but we are getting only 29 records as result.
Is there is api based on site filter? so we get share id of all document from particular site?
kindly suggest on this!