Skip to main content

Add multiple file permissions

POST /api/v1/files/{fileId}/permissions/multiple HTTP/1.1

Generates Notification file share.

  1. Path parameters
ParameterDescription
fileIdThe ID of the file.
  1. Request fields
PathTypeDescription
sendEmailBooleanSend email after set permission or not
userMessageStringUser message to add in email
permissionStrategyStringPermission strategy
notifyBooleanFlag. If enabled, notify subscribed users
permissions[]ArrayArray of permission objects. See add permission [resources-add-permission-fields]
permissions[].idStringThe user’s login or groupId for this permission
permissions[].emailStringThe user’s email for this permission
permissions[].fsPermIdStringThe user’s id or group’s id if it’s a group permission
permissions[].parentShareIdStringShared parent folder
permissions[].parentShareFilenameStringParent share filename
permissions[].shareUserFirstNameStringShare user first name
permissions[].shareUserLastNameStringShare user last name
permissions[].shareUserMiddleNameStringShare user middle name
permissions[].shareUserAvatarIdStringShare user avatar id
permissions[].roleStringThe primary role for this user/group
permissions[].isGroupBooleanGroup permission indicator
permissions[].groupNameStringPermission group name
permissions[].loginStringPermission user login
permissions[].isDeletedBooleanThe user was deleted
  1. Response structure
PathTypeDescription
content[]ArrayArray of permission objects
content[].links[]ArrayPermission’s links
links[]ArrayThis request links
content[].permission.idStringThe user’s login or groupId for this permission
content[].permission.emailStringThe user’s email for this permission
content[].permission.fsPermIdStringThe user’s id or group’s id if it’s a group permission
content[].permission.parentShareIdStringShared parent folder
content[].permission.parentShareFilenameStringParent share filename
content[].permission.shareUserFirstNameStringShare user first name
content[].permission.shareUserLastNameStringShare user last name
content[].permission.shareUserMiddleNameStringShare user middle name
content[].permission.shareUserAvatarIdStringShare user avatar id
content[].permission.roleStringThe primary role for this user/group
content[].permission.isGroupBooleanGroup permission indicator
content[].permission.groupNameStringPermission group name
content[].permission.loginStringPermission user login
content[].permission.isDeletedThe user was deleted
content[].links[].relStringLink type
content[].links[].hrefStringLink reference
links[].relStringLink type
links[].hrefStringLink reference
  1. Example request
curl 'http://localhost:8080/api/v1/files/189386174/permissions/multiple' -i -X POST \
-H 'Content-Type: application/json' \
-H 'X-co-auth-token: 9984ce04e7c90904bda50723e917d812' \
-d '{
"notify" : false,
"permissions" : [ {
"id" : "testsrvdocs2@tacos.devoffice.ru",
"email" : "testsrvdocs2@tacos.devoffice.ru",
"isGroup" : false,
"role" : "editor"
} ],
"sendEmail" : false,
"userMessage" : "",
"permissionStrategy" : "DEFAULT"
}'
  1. Example response
HTTP/1.1 200 OK
X-co-request-id: 70416146587a54785568545a75555651
Content-Type: application/vnd.ncloudtech.cloudoffice.permissionlist+json;v=1;charset=UTF-8
Content-Length: 667
{
"links": [
{
"rel": "self",
"href": "http://localhost:8080/api/v1/files/189386174/permissions/multiple"
}
],
"content": [
{
"permission": {
"id": "testsrvdocs2@tacos.devoffice.ru",
"email": "testsrvdocs2@tacos.devoffice.ru",
"fsPermId": "9fb6f399abda5f1eac5b88a7586c953e",
"isGroup": false,
"role": "editor",
"shareUserAvatarId": "8bd73b29-b7a8-4adb-b703-0d005c235f80",
"shareUserFirstName": "a",
"shareUserLastName": "s",
"shareUserMiddleName": "d"
},
"links": [
{
"rel": "self",
"href": "http://localhost:8080/api/v1/files/testsrvdocs2@tacos.devoffice.ru"
}
]
}
]
}