Add multiple file permissions
POST /api/v1/files/{fileId}/permissions/multiple HTTP/1.1
Generates Notification file share.
- Path parameters
| Parameter | Description |
|---|---|
fileId | The ID of the file. |
- Request fields
| Path | Type | Description |
|---|---|---|
sendEmail | Boolean | Send email after set permission or not |
userMessage | String | User message to add in email |
permissionStrategy | String | Permission strategy |
notify | Boolean | Flag. If enabled, notify subscribed users |
permissions[] | Array | Array of permission objects. See add permission [resources-add-permission-fields] |
permissions[].id | String | The user’s login or groupId for this permission |
permissions[].email | String | The user’s email for this permission |
permissions[].fsPermId | String | The user’s id or group’s id if it’s a group permission |
permissions[].parentShareId | String | Shared parent folder |
permissions[].parentShareFilename | String | Parent share filename |
permissions[].shareUserFirstName | String | Share user first name |
permissions[].shareUserLastName | String | Share user last name |
permissions[].shareUserMiddleName | String | Share user middle name |
permissions[].shareUserAvatarId | String | Share user avatar id |
permissions[].role | String | The primary role for this user/group |
permissions[].isGroup | Boolean | Group permission indicator |
permissions[].groupName | String | Permission group name |
permissions[].login | String | Permission user login |
permissions[].isDeleted | Boolean | The user was deleted |
- Response structure
| Path | Type | Description |
|---|---|---|
content[] | Array | Array of permission objects |
content[].links[] | Array | Permission’s links |
links[] | Array | This request links |
content[].permission.id | String | The user’s login or groupId for this permission |
content[].permission.email | String | The user’s email for this permission |
content[].permission.fsPermId | String | The user’s id or group’s id if it’s a group permission |
content[].permission.parentShareId | String | Shared parent folder |
content[].permission.parentShareFilename | String | Parent share filename |
content[].permission.shareUserFirstName | String | Share user first name |
content[].permission.shareUserLastName | String | Share user last name |
content[].permission.shareUserMiddleName | String | Share user middle name |
content[].permission.shareUserAvatarId | String | Share user avatar id |
content[].permission.role | String | The primary role for this user/group |
content[].permission.isGroup | Boolean | Group permission indicator |
content[].permission.groupName | String | Permission group name |
content[].permission.login | String | Permission user login |
content[].permission.isDeleted | The user was deleted | |
content[].links[].rel | String | Link type |
content[].links[].href | String | Link reference |
links[].rel | String | Link type |
links[].href | String | Link reference |
- 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"
}'
- 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"
}
]
}
]
}