setFolderSecurityInfo
FileShareArrayWrapper setFolderSecurityInfo(id, SecurityInfoSimpleRequestDto)
PUT /api/2.0/files/folder/{id}/share
Share a folder
Grants, changes or withdraws the rights of the listed accounts and groups on one folder, and answers with the rights those subjects hold afterwards. Every element of share names a subject and the level it is to get, and the level that denies everything takes the access away instead; an empty share changes nothing and is answered with an empty list. A subject the caller is not allowed to share with, such as a guest who belongs to another member, is dropped without an error. With notify set, each account named is emailed about the access it received and sharingMessage is put into that mail with its markup stripped, while a message longer than the field allows is rejected as an invalid request. The caller has to be allowed to change the sharing of the folder, which the manager of the room it belongs to and a portal administrator acting as room manager are; anyone else, a guest and a member with read access included, is refused. The call is mutating and safe to repeat. For a room use PUT api/2.0/files/rooms/{id}/share, which invites people by email as well.
Parameters
| Name | In | Type | Description | Notes |
|---|---|---|---|---|
| id | path | Integer (int32) | The folder whose sharing is being changed. A folder stored on the portal is numbered, while a folder in a connected third-party account is named by an opaque string. | [required] [example: 10] |
| SecurityInfoSimpleRequestDto | body | SecurityInfoSimpleRequestDto | The rights to apply to the folder, and whether to announce them by mail. | [required] |
Responses
| Status code | Description | Type | Response headers |
|---|---|---|---|
| 200 | The rights the listed subjects hold on the folder after the change | FileShareArrayWrapper | X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset |
| 400 | The request body cannot be read, an email in share is malformed or longer than 255 characters, share invites more addresses by email than the portal allows at once, or sharingMessage is longer than 255 characters | - | - |
| 403 | The caller may not change the sharing of the folder, a listed subject cannot be given the requested access on it, or the folder is a private room and a listed account has not set up its encryption keys | - | - |
| 401 | Unauthorized | ErrorApiResponse | - |
| 429 | Too Many Requests. | ErrorApiResponse | Retry-After |
| 500 | Internal Server Error. | ErrorApiResponse | - |
| 502 | Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. | - | - |
| 503 | Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. | - | - |
Return type
Third-party storage
For a file or folder in a connected third-party storage the identifier is a string such as sbox-42, and the call differs in these parts only:
| Name | In | Type | Description | Notes |
|---|---|---|---|---|
| id | path | String | The folder whose sharing is being changed. A folder stored on the portal is numbered, while a folder in a connected third-party account is named by an opaque string. | [required] [example: sbox-42] |
Authorization
Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId
HTTP request headers
- Content-Type: application/json
- Accept: application/json