javarestsdkalfrescoalfresco-share

Alfresco Rest api get document shared link


I need to share and unshare the content in alfresco using Rest API,

I read the sharedLinks documentation but I don't know how to retrieve the document url I want to share. This endpoint return an object with this properties :

{
  "entry": {
    "id": "string",
    "expiresAt": "2022-03-23T18:16:00.603Z",
    "nodeId": "string",
    "name": "string",
    "title": "string",
    "description": "string",
    "modifiedAt": "2022-03-23T18:16:00.603Z",
    "modifiedByUser": {
      "displayName": "string",
      "id": "string"
    },
    "sharedByUser": {
      "displayName": "string",
      "id": "string"
    },
    "content": {
      "mimeType": "string",
      "mimeTypeName": "string",
      "sizeInBytes": 0,
      "encoding": "string"
    },
    "allowableOperations": [
      "string"
    ],
    "allowableOperationsOnTarget": [
      "string"
    ],
    "isFavorite": true,
    "properties": {},
    "aspectNames": [
      "string"
    ],
    "path": {
      "elements": [
        {
          "id": "string",
          "name": "string",
          "nodeType": "string",
          "aspectNames": [
            "string"
          ]
        }
      ],
      "name": "string",
      "isComplete": true
    }
  }
}

How can i retrieve the path from the response?

Is there another way to get the effective complete shared link for a document ?


Solution

  • The response returns you an ID of the share link.

    Example: "id": "riqJ3xV3M4RNxJm6Haa7-w"

    Use this ID to access the share link : https://your.alfresco.domaine/share/s/riqJ3xV3M4RNxJm6Haa7-w

    You can also use this web service : emailSharedLink to send an email with the link to the shared document.