Revoke User
/documents/api/1.2/shares/{folderId}/user
Delete a user's or group's access to a shared folder.
Request
- application/json
- application/xml
-
folderId: string
Globally unique identifier (GUID) for the folder. If the referenced folder is the user's home folder, the value for
folderId
isself
.
-
message(optional): string
Optional message sent to the user.
-
userID: string
Globally unique identifier (GUID) for the user, login name of the user, GUID for the group or a comma-separated list of the above (no more than 1000 total IDs).
Response
- application/json
- application/xml
200 Response
The request was fulfilled.
{
"errorCode":"0",
"id":"F1321DC48E3B123D02DBEE88T0000000000100000001",
"members":[
{
"id":"U7ECC74059E0FEDFEC66BF5AT00000000001",
"displayName":"User BB",
"type":"user",
"isSuccessful":"1",
"provisioningStatus":"active"
}
],
"type":"share",
"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 manager permission or if there was a problem removing one or more user or group.
404 Response
Folder ID is not found.
Examples
The following example removes access to the specified folder for the specified user.
DELETE .../shares/F1321DC48E3B123D02DBEE88T0000000000100000001/user?userID=U7ECC74059E0FEDFEC66BF5AT00000000001&message=removing your access to this shared folder
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "errorCode": "0", "id": "F1321DC48E3B123D02DBEE88T0000000000100000001", "members": [ { "id": "U6A0B35B0548F250914D18FDB5D17B95F470", "displayName": "User BB", "type": "user", "isSuccessful": "1", "provisioningStatus": "active" } ], "type": "share", "user": { "displayName": "User BB", "loginName": "userBBLoginName", "id": "U7ECC74059E0FEDFEC66BF5AT00000000001", "type": "user" } }
Example 2
The following example returns an error because the userID
parameter is missing from the request body.
DELETE .../shares/F2CD745706AEC8BD04260B2F45B3E9DD64907CA0D19F/user?message=revoke share
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 400
JSON Response
{ "errorCode": "-97", "errorKey": "!csUnableToRemoveSharedUser!csRequiredServiceParameterMissing,dUserID,REVOKE_SHARED_USER", "errorMessage": "Failed to remove shared user on folder. Parameter 'dUserID' required by service REVOKE_SHARED_USER is missing.", "errorType": "share", "id": "F2CD745706AEC8BD04260B2F45B3E9DD64907CA0D19F", "title": "Failed to remove shared user on folder. Parameter 'dUserID' required by service REVOKE_SHARED_USER is missing.", "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" }
Example 3
The following example returns an error because the folder ID is invalid.
DELETE .../shares/FDDD745706AEC8BD04260B2F45B3E9DD64907CA0D19F/user?userID=U5C4D5FCE14F2B44946FA74745B3E9DD6490
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 404
JSON Response
{ "errorCode": "-16", "errorKey": "!csUnableToRemoveSharedUser!csSecurityValidationFailed!csFldDoesNotExist,FDDD745706AEC8BD04260B2F45B3E9DD64907CA0D19F!csUnprivilegedSystemError", "errorMessage": "Failed to remove shared user on folder. Security validation failed. 'FDDD745706AEC8BD04260B2F45B3E9DD64907CA0D19F' does not exist. The error was caused by an internally generated issue. The error has been logged.", "errorType": "share", "id": "FDDD745706AEC8BD04260B2F45B3E9DD64907CA0D19F", "title": "Failed to remove shared user on folder. Security validation failed. 'FDDD745706AEC8BD04260B2F45B3E9DD64907CA0D19F' does not exist. The error was caused by an internally generated issue. The error has been logged.", "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "user": { "id": "U5C4D5FCE14F2B44946FA74745B3E9DD6490", "type": "user" } }
Example 4
The following example removes access to the specified folder for the given user and group.
DELETE .../shares/F1321DC48E3B123D02DBEE88T0000000000100000001/user?userID=U7ECC74059E0FEDFEC66BF5AT00000000001,GS18003&message=removing your access to this shared folder
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "errorCode": "0", "id": "F1321DC48E3B123D02DBEE88T0000000000100000001", "members": [ { "id": "U6A0B35B0548F250914D18FDB5D17B95F470", "displayName": "User BB", "type": "user", "isSuccessful": "1", "provisioningStatus": "active" }, { "id": "GS18003", "displayName": "Sales Group", "type": "group", "isSuccessful": "1", "provisioningStatus": "active" } ], "type": "share", "user": { "id": "U6A0B35B0548F250914D18FDB5D17B95F470,GS18003", "type": "user" } }