cancel
Showing results for 
Search instead for 
Did you mean: 

Get shared-links from file by API

fumagally
Champ in-the-making
Champ in-the-making
Hi.. how to get a ID from shared-links by API?

I try to get links using 

/alfresco/api/-default-/public/alfresco/versions/1/shared-links?where=(nodeId='XXXXXXXXXXXX')
and
/alfresco/api/-default-/public/alfresco/versions/1/shared-links?where=(id='XXXXXXXXXXXX')
 
but not success... this message diplayed:
 
{"error":{"errorKey":"framework.exception.InvalidProperty","statusCode":400,"briefSummary":"08100110 The property 'id' with value '53c9bb6f-3175-4f2c-8450-4df8e5a59089' isn't supported for EQUALS comparison","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"}}
1 REPLY 1

abhinavmishra14
World-Class Innovator
World-Class Innovator

Checkout the details here:

https://api-explorer.alfresco.com/api-explorer/#/shared-links/listSharedLinks

https://api-explorer.alfresco.com/api-explorer/#/shared-links/getSharedLink

Access link from share app: http://127.0.0.1:8080/share/s/3ylyPBLMQZmyQY1k7mUi1Q

Only "sharedByUser" param is supported as per this api: https://github.com/Alfresco/alfresco-community-repo/blob/master/remote-api/src/main/java/org/alfresc...

nodeId= is not supported looks like if you see the above QuickShareLinks.java class.

Sample:

curl -X GET -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "accept: application/json" http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/shared-links?skipCount=0&maxItems=10cls0&where=(sharedByUser='admin')
GET -> http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/shared-links?skipCount=0&maxItems=100&where=(sharedByUser='admin')&alf_ticket=TICKET_76ee3861046173941032ca06479efdb70d0e0f0b

You probably want to use sharedId based api, example:

http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/shared-links/<sharedId>

curl -X GET -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "accept: application/json" http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/shared-links/3ylyPBLMQZmyQY1k7mUi1Q

GET -> http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/shared-links/3ylyPBLMQZmyQY1k7mUi1Q?alf_ticket=TICKET_76ee3861046173941032ca06479efdb70d0e0f0b
~Abhinav
(ACSCE, AWS SAA, Azure Admin)