跳到主要内容

createFolderPrimaryExternalLink

FileShareWrapper createFolderPrimaryExternalLink(id, FolderLinkRequest)

POST /api/2.0/files/folder/{id}/link

Create the folder primary external link

Answers with the primary external link of a folder or a room, creating it on the first call and returning the one that already exists afterwards, so the operation is idempotent in effect: a second call with other parameters does not reconfigure the existing link, and changing one is the business of PUT api/2.0/files/folder/{id}/links. The parameters therefore only shape the link at the moment it is born - access its rights, title its name, expirationDate its lifetime, which is unlimited here unless one is given, internal whether only signed-in members may follow it, denyDownload whether the contents may only be viewed, and password a secret to be asked for. Sending access with the value that grants nothing creates no link and answers with nothing. The caller needs the right to manage the links of the room the folder belongs to, which its manager and a portal administrator acting as room manager have, and a member with content-creator or read access is refused with 403; an unknown folder is answered with 404. Read the address from sharedTo.shareLink.

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 primary external link of the folderFileShareWrapperX-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 restricts external links to public rooms--
404The folder does not exist, or its primary link was revoked--
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