Create Folder Public Link

post

/documents/api/1.1/publiclinks/folder/{folderId}

Create a public link for a specified folder.

A public link allows specific users access to the requested folder, whether they have an account or not.

Note:

To create a public link, the requester must have admin privileges for the folder or file. That is, the requester must be the owner or have the manager role.

Request

Supported Media Types
  • application/json
  • application/xml
Path Parameters
folderId
Type: string
Required: true
Globally unique identifier (GUID) for the folder.
Body Parameter
The request body defines details of the create public link request. Bold indicates a required value.
Root Schema : PublicLinkBody
The request body defines details of the create public link request. Bold indicates a required value.
Example application/json

{
    "assignedUsers":"@serviceinstance",
    "expirationTime":"2016-01-01T00:00:01Z",
    "password":"MyPassword",
    "linkName":"MyLinkOne",
    "role":"contributor"
}

Response

Supported Media Types
  • application/json
  • application/xml
200 Response

The request was fulfilled.

Body
The response body includes information about the newly created public link.
Root Schema : PublicLinkCreateResponse
Type: object
The response body includes information about the newly created public link.
Nested Schema : PublicLinkDefinition
Public link information.
Nested Schema : User
User information
Example application/json

{
    "linkID":"LF906748A021ACD714CABC82T0000000000100000001",
    "linkName":"MyLinkOne",
    "assignedUsers":"@serviceinstance",
    "role":"contributor",
    "type":"publiclink",
    "createdTime":"2015-06-10T16:01:44Z",
    "expirationTime":"2016-01-01T00:00:01Z",
    "lastModifiedTime":"2015-06-10T16:01:44Z",
    "ownedBy":{
        "id":"U0EAA20910FAF3052ACB79E4T00000000001",
        "displayName":"User AA",
        "type":"user"
    },
    "errorCode":"0",
    "id":"FBE1117A270E747BB1D95024T0000000000100000001"
}
400 Response

Request parameters are not formatted correctly.

403 Response

Forbidden if the user does not have read permission.

404 Response

Folder ID is not found.

Examples

The following example grants contributor-level access to all account holders for the Content and Experience instance that hosts the specified folder.

POST .../publiclinks/folder/FBE1117A270E747BB1D95024T0000000000100000001

Request Header

None.

Request Body

{
	"assignedUsers": "@serviceinstance",
	"expirationTime": "2016-01-01T00:00:01Z",
	"password": "MyPassword",
	"linkName": "MyLinkOne",
	"role": "contributor"
}

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "assignedUsers": "@everybody",
    "createdTime": "2015-06-10T16:01:44Z",
    "errorCode": "0",
    "expirationTime": "2016-01-01T00:00:01Z",
    "id": "FBE1117A270E747BB1D95024T0000000000100000001",
    "lastModifiedTime": "2015-06-10T16:01:44Z",
    "linkID": "LF906748A021ACD714CABC82T0000000000100000001",
    "linkName": "MyLinkOne",
    "ownedBy": {
        "displayName": "User AA",
        "id": "U0EAA20910FAF3052ACB79E4T00000000001",
        "type": "user"
    },
    "role": "contributor",
    "type": "publiclink"
}