Skip to main content

setFolderPrimaryExternalLink

FileShareWrapper setFolderPrimaryExternalLink(id, FolderLinkRequest)

PUT /api/2.0/files/folder/{id}/links

Set the folder external link

Creates an external link to a folder or a room, or changes or revokes an existing one, and answers with the link as it now stands. linkId decides which: an identifier that is not yet in use, the empty one included, creates a link, while the identifier of an existing link rewrites it, so the whole set of parameters is applied every time and a field left out is reset rather than kept. access carries the rights the link grants, and access set to the value that denies everything revokes the link instead - the answer is then empty, and a revoked primary link is not recreated by a later read. title names the link for the people who manage it, expirationDate limits its lifetime and is ignored when it lies in the past, password asks visitors for a secret, denyDownload leaves them with viewing only, internal admits signed-in members alone, and primary=true makes it the primary link of the folder. The caller needs the right to manage the links of the room, which its manager and a portal administrator acting as room manager have; anyone else is refused and an unknown folder is answered as not found. The call is mutating.

Parameters​

NameInTypeDescriptionNotes
idpathInteger (int32)The folder or room the link belongs to.[required] [example: 1]
FolderLinkRequestbodyFolderLinkRequestThe link and the way it is to be shaped.[required]

Responses​

Status codeDescriptionTypeResponse headers
200The link as it now stands, or nothing when it was revokedFileShareWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The title or password is longer than 255 characters, the password does not meet the portal password policy, or expirationDate lies more than 10 years ahead--
403The caller may not manage the links of this folder, the access level is not available for links to this folder, the link limit is reached, or the admin's restriction on external links forbids the change--
404The folder does not exist--
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​

FileShareWrapper

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 or room the link belongs to.[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