Skip to main content

Modify permission role

PUT /api/v1/files/{fileId}/permissions/{permId} HTTP/1.1

Generates Notification file’s permissions changed.

  1. Path parameters
ParameterDescription
fileIdThe ID of the file.
permIdThe user’s login or groupId.
  1. Request fields
PathTypeDescription
idStringThe user’s login or groupId for this permission.
fsPermIdStringThe user’s id or groupId for this permission.
emailStringThe user’s email for this permission.
roleStringThe primary role for this user/group.
isGroupBooleanGroup permission indicator.
  1. Request parameters
ParameterDescription
sendEmailShould server send email
  1. Response structure

See Get Permission Response structure.

  1. Example request
curl 'http://localhost:8080/api/v1/files/189413843/permissions/testsrvdocs2@tacos.devoffice.ru' -i -X PUT \
-H 'Content-Type: application/json' \
-H 'X-co-auth-token: 02d8e21739b77e7543163824140607ad' \
-d '{
"id" : "testsrvdocs2@tacos.devoffice.ru",
"email" : "testsrvdocs2@tacos.devoffice.ru",
"fsPermId" : "07169c7868a343e5835c4c5db8255087",
"isGroup" : false,
"role" : "viewer"
}'
  1. Example response
HTTP/1.1 200 OK
X-co-request-id: 556169754172596c454c7a6234666e6f
Content-Disposition: inline;filename=f.txt
Content-Type: application/vnd.ncloudtech.cloudoffice.permission+json;v=1;charset=UTF-8
Content-Length: 519
{
"permission": {
"id": "testsrvdocs2@tacos.devoffice.ru",
"email": "testsrvdocs2@tacos.devoffice.ru",
"fsPermId": "07169c7868a343e5835c4c5db8255087",
"isGroup": false,
"role": "viewer",
"shareUserAvatarId": "8bd73b29-b7a8-4adb-b703-0d005c235f80",
"shareUserFirstName": "a",
"shareUserLastName": "s",
"shareUserMiddleName": "s"
},
"links": [
{
"rel": "self",
"href": "http://localhost:8080/api/v1/files/testsrvdocs2@tacos.devoffice.ru"
}
]
}