Skip to main content

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​

NameInTypeDescriptionNotes
idpathInteger (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]
SecurityInfoSimpleRequestDtobodySecurityInfoSimpleRequestDtoThe rights to apply to the folder, and whether to announce them by mail.[required]

Responses​

Status codeDescriptionTypeResponse headers
200The rights the listed subjects hold on the folder after the changeFileShareArrayWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The 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--
403The 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--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

FileShareArrayWrapper

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:

NameInTypeDescriptionNotes
idpathStringThe 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