Edit Public Link
/documents/api/1.2/publiclinks/{linkId}
Edit the available public link parameters.
Request
- application/json
- application/xml
-
linkId: string
Globally unique identifier (GUID) for the public link.
object
-
assignedUsers(optional):
string
The group of users who can use the link.
- Comma-separated list of users (any of user ID, login name, or email address).
- @serviceinstance: Users with an account can access the resource with the privileges specified by the role.
- @everybody: Any user can access the resource with the privileges specified by the role
-
expirationTime(optional):
string
Date and time when the public link expires, in the form
yyyy-mm-ddThh:mm:ss
.For example, 2017-01-01T00:00:01.
If you do not specify an expiration time, the link is valid until you delete the link. -
password(optional):
string
Password for the public link. Use a minimum of 8 characters and a maximum of 50 characters. If you do not specify a password, no password is required to use the link.
-
role(optional):
string
Allowed Values:
[ "viewer", "downloader", "contributor" ]
Access level for the shared item.
Note:
Although the default role is viewer, the API user's preference setting for the default role for public links can override this default with a different value. It is best practice to explicitly set the role with the service call.
You can grant the specified user any standard role except manager or owner:
- Viewer: Viewers can look at files and folders, but can't change things.
- Downloader: Downloaders can also download files and save them to their own computer.
- Contributor: Contributors can also modify files, update files, upload new files, and delete files.
{
"assignedUsers":"@everybody",
"expirationTime":"2016-02-15T01:02:03",
"password":"password2",
"role":"viewer"
}
Response
- application/json
- application/xml
200 Response
The request was fulfilled.
object
-
errorCode(optional):
string
An error code of zero (0) indicates no errors.
-
object
PublicLinkDefinition
Public link information.
object
-
assignedUsers(optional):
string
The group of users who can use the link.
-
createdTime(optional):
string
Date and time when the public link was created.
-
expirationTime(optional):
string
Date and time when the public link expires.
-
lastModifiedTime(optional):
string
Date and time when the public link was last modified.
-
linkID(optional):
string
Globally unique identifier (GUID) for the public link.
-
linkName(optional):
string
Name of the public link.
-
ownedBy(optional):
object User
User information
-
password(optional):
string
Password for the public link. Use a minimum of 8 characters and a maximum of 50 characters. Passwords are case-sensitive.
-
role(optional):
string
Allowed Values:
[ "viewer", "downloader", "contributor" ]
Access level for the shared item. -
type(optional):
string
Item type
publiclink
.
object
-
displayName(optional):
string
The display name for the user.
-
id(optional):
string
Globally unique identifier (GUID) for the user.
-
loginName(optional):
string
The login name for the user.
-
type(optional):
string
Item type
user
.
{
"linkID":"LFCE8A35C88A6A96FD39B621T0000000000100000001",
"linkName":"pub-test-158",
"assignedUsers":"@everybody",
"role":"viewer",
"type":"publiclink",
"createdTime":"2015-06-05T21:04:56Z",
"expirationTime":"2016-02-15T01:02:03Z",
"lastModifiedTime":"2015-06-10T22:01:08Z",
"ownedBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
},
"errorCode":"0"
}
400 Response
Request parameters are not formatted correctly.
403 Response
Forbidden if the user does not have read permission.
404 Response
Link ID is not found.
Examples
The following example assigns values for all of the available parameters of the specified public link.
PUT .../publiclinks/LFCE8A35C88A6A96FD39B621T0000000000100000001
Request Header
None.
Request Body
{ "assignedUsers": "@everybody", "expirationTime": "2016-02-15T01:02:03", "password": "password2", "role": "viewer" }
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "assignedUsers": "@everybody", "createdTime": "2015-06-05T21:04:56Z", "errorCode": "0", "expirationTime": "2016-02-15T01:02:03Z", "lastModifiedTime": "2015-06-10T22:01:08Z", "linkID": "LFCE8A35C88A6A96FD39B621T0000000000100000001", "linkName": "pub-test-158", "ownedBy": { "displayName": "User AA", "loginName": "userAALoginName", "id": "U0EAA20910FAF3052ACB79E4T00000000001", "type": "user" }, "role": "viewer", "type": "publiclink" }
Example 2
The following example does not edit the specified public link because role
parameter in the request body is invalid.
PUT .../publiclinks/LFE30701FF7D3371DCD7F9E245B3E9DD64907CA0D19F
Request Header
None.
Request Body
{ "assignedUsers": "@everybody", "linkName": "MyPublicLink1", "role": "vieweronly" }
HTTP Status Code
HTTP_STATUS = 400
JSON Response
{ "errorCode": "-96", "errorKey": "!csUnableToEditSharedLink!csInvalidSharingRole,vieweronly", "errorMessage": "Failed to edit shared link. Invalid sharing role 'vieweronly'.", "errorType": "publiclink", "linkID": "LFE30701FF7D3371DCD7F9E245B3E9DD64907CA0D19F", "role": "vieweronly", "title": "Failed to edit shared link. Invalid sharing role 'vieweronly'.", "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" }
Example 3
The following example does not edit the specified public link because the link ID is invalid.
PUT .../publiclinks/LFE30701FF7D3371DCD7F9E245B3E9DD64907CA0D19F
Request Header
None.
Request Body
{ "assignedUsers": "@everybody", "linkName": "MyPublicLink1", "role": "downloader" }
HTTP Status Code
HTTP_STATUS = 404
JSON Response
{ "assignedUsers": "@everybody", "errorCode": "-16", "errorKey": "!csUnableToEditSharedLink!csUnableToFindLink", "errorMessage": "Failed to edit shared link. Unable to find the specified shared link.", "errorType": "publiclink", "linkID": "LFE30709FF7D3371DCD7F9E245B3E9DD64907CA0D19F", "role": "downloader", "title": "Failed to edit shared link. Unable to find the specified shared link.", "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" }