跳到主要内容

getFolderPrimaryExternalLink

FileShareWrapper getFolderPrimaryExternalLink(id, count, startIndex)

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

Get the folder primary external link

Answers with the primary external link of a folder or a room - the one the Copy link action of a client hands out - with its address in sharedTo.shareLink, its rights in access, and its title, expiration date, password flag and download restriction beside them. The link is created on the first read if the folder has none, with read rights, no password and no expiry, so this operation mutates on that first call and is a plain read afterwards; repeated calls answer with the same link identifier. 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; a member with read access alone is refused with 403 and an anonymous caller is rejected, while a link that was deliberately revoked is answered with 404 rather than being recreated. The paging parameters are accepted for compatibility and leave the single link answered here unchanged. Every external link of the same folder is listed by GET api/2.0/files/folder/{id}/links.

Parameters​

NameInTypeDescriptionNotes
idpathInteger (int32)The folder or room the operation addresses. 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]
countqueryInteger (int32)How many entries at most to answer with, in the operations of this folder that return a list; an operation that answers with a single object is not affected by it.[optional] [example: 25] [min: 1] [max: 100]
startIndexqueryInteger (int32)How many entries of such a list to skip before answering, used together with count to walk through it page by page.[optional] [example: 0]

Responses​

Status codeDescriptionTypeResponse headers
200The primary external link of the folderFileShareWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400A parameter has the wrong type, or the count is outside its allowed range--
401An anonymous caller has no external link--
403The caller may not manage the links of this folder--
404The folder does not exist, or its primary link was revoked--
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 operation addresses. 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: Not defined
  • Accept: application/json