Provide Access to Files and Folders with Public Links

To give users access to files and folders, you can use public links to share the files and folders with assigned users.

Note:

Public links aren't supported in private instances.

You can create multiple, named links for the same file or folder resource with different access roles, expiration dates, and so on. You can also edit some of the information for an existing public link.

To provide access to a files and folders with a public links:

  1. Use the Create File Public Link and Create Folder Public link REST APIs to create the public links you need.

  2. If you want to edit the available public link parameters, use Edit Public Link REST API.

  3. Use the Get File Public Link or Get Folder Public Link REST API to get information about the pubic links available for a file or folder.

    For example, the follow Get Folder Public Link request specifies the folder ID F4E111D0D0645CD368453C2BT0000000000100000001:

    GET . . ./publiclinks/folder/F4E111D0D0645CD368453C2BT0000000000100000001

    If the HTTP Status Code is 200 and one or more public links are available for the specified folder, the response returns information about public links defined for the folder:

    {
        "count": "2",
        "errorCode": "0",
        "id": "F4E111D0D0645CD368453C2BT0000000000100000001",
        "type": "folder",
        "items": [
            {
                "type": "publiclink",
                "linkID": "LF31C09DE51854DBBDA37A90T0000000000100000001",
                "linkName": "hasSecondLink",
                "ownedBy": {
    		            "displayName": "User AA",
    		            "loginName": "userAALoginName",
    		            "id": "U0EAA20910FAF3052ACB79E4T00000000001",
    		            "type": "user"
                },
                "role": "viewer",
                "assignedUsers": "@everybody",
                "createdTime": "2015-06-02T19:30:37Z",
                "lastModifiedTime": "2015-06-02T19:30:37Z"
            },
            {
                "type": "publiclink",
                "linkID": "LF5E5F73A444FFB8924EF8ACT0000000000100000001",
                "linkName": "hasFirstLink",
                "ownedBy": {
    		            "displayName": "User AA",
    		            "loginName": "userAALoginName",
    		            "id": "U0EAA20910FAF3052ACB79E4T00000000001",
    		            "type": "user"
                },
                "role": "contributor",
                "assignedUsers": "@serviceinstance",
                "createdTime": "2015-06-10T16:15:37Z",
                "lastModifiedTime": "2015-06-10T16:15:37Z"
            }
        ]
    }

    This response shows that two public links are available, one for users who are assigned the viewer role for the folder and one for users who are assigned the contributor role. You use information from the response in API headers to share the folder with the assigned users (assignedUsers value) specified in the public link.

    In the example, the second link grants contributor-level access to all account holders for the Content Management instance that hosts the specified folder.

    For example:

    @serviceinstance/documents/link/LF5E5F73A444FFB8924EF8ACT0000000000100000001/folder/F4E111D0D0645CD368453C2BT0000000000100000001
  4. To share a file or folder, use the information from the response in the headers of other APIs, like Share Folder or Collection.

A web client can use a URL in one of the following formats to allow file or folder visualization through a public link:

domain URL/documents/link/linkID/fileview/file ID

domain URL/documents/link/linkID/folder/folder ID

For more information about public links, see Publiclinks Resource or "Publiclinks" in REST API for Documents.