Edit Shared Folder User Role

put

/documents/api/1.1/shares/{folderId}/role

Change the role of a user for a shared folder.

Request

Supported Media Types
  • application/json
  • application/xml
Path Parameters
folderId
Type: string
Required: true

Globally unique identifier (GUID) for the folder. If the referenced folder is the user's home folder, the value for folderId is self

.
Body Parameter
The request body defines details of the edit shared folder user role request. Bold indicates a required value.
Root Schema : ShareFolderEditRoleBody
The request body defines details of the edit shared folder user role request. Bold indicates a required value.
Example application/json

{
    "userID":"U7ECC74059E0FEDFEC66BF5AT00000000001",
    "role":"viewer",
    "message":"Changing your shared access rights to viewer."
}

Response

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

The request was fulfilled.

Body
The response body includes share information along with user information.
Root Schema : ShareFolderResponse
The response body includes share information along with user information.
Nested Schema : User
User information
Example application/json

{
    "id":"F1321DC48E3B123D02DBEE88T0000000000100000001",
    "role":"viewer",
    "type":"share",
    "errorCode":"0",
    "user":{
        "id":"U7ECC74059E0FEDFEC66BF5AT00000000001",
        "displayName":"User BB",
        "type":"user"
    }
}
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 changes the access level for the specified folder to viewer for the specified user.

PUT .../shares/F1321DC48E3B123D02DBEE88T0000000000100000001/role

Request Header

None.

Request Body

{
    "userID": " U7ECC74059E0FEDFEC66BF5AT00000000001",
    "role": "viewer",
    "message": "Changing your shared access rights to viewer"
}

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "errorCode": "0",
    "id": "F1321DC48E3B123D02DBEE88T0000000000100000001",
    "role": "viewer",
    "type": "share",
    "user": {
        "displayName": "User BB",
        "id": "U7ECC74059E0FEDFEC66BF5AT00000000001",
        "type": "user"
    }
}