跳到主要内容

setFolderOrder

FolderWrapper setFolderOrder(folderId, OrderRequestDto)

PUT /api/2.0/files/folder/{folderId}/order

Set folder order

Puts a folder at a given position among the entries of its parent and answers with the folder, its order reporting where it now stands. Positions count from 1, and the entry that held the wanted position, together with everything after it, is shifted to make room, so the numbering of the parent stays without gaps; a position beyond the end places the folder last. The value may also be sent as a dotted path, as in 1.2.3, in which case only its last segment is read. Ordering is what the manual arrangement of a room is built on, and it only means something in rooms whose contents are indexed - elsewhere the value is stored and ignored. The caller needs edit access to the folder, which room managers and content creators have, and a member without it is refused, while a folder that does not exist is answered as not found. The call is mutating and idempotent. To move several entries in one go use PUT api/2.0/files/order.

Parameters​

NameInTypeDescriptionNotes
folderIdpathInteger (int32)The folder to move.[required] [example: 1]
OrderRequestDtobodyOrderRequestDtoThe position the folder is to take.[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The folder with the position it now holdsFolderWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read, or order is below 1 or is neither a number nor a dotted path ending in one--
403The caller may not reorder this folder--
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​

FolderWrapper

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
folderIdpathStringThe folder to move.[required] [example: sbox-42]

Return type: ThirdPartyFolderWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json