跳到主要内容

checkUpload

StringArrayWrapper checkUpload(folderId, CheckUploadRequest)

POST /api/2.0/files/{folderId}/upload/check

Check for upload conflicts

Reports which of the submitted titles already belong to a file in the folder, so an upload can decide in advance whether to overwrite or to ask for another name. Only the clashing titles come back, unordered and without repetitions, and an empty array means every name is free. Matching is by title and ignores case, so a name that differs only in capitalisation is still reported; an existing file that is encrypted is left out, because an upload cannot take it over. The call changes nothing. It needs the same right as the upload itself, the right to add content to the folder, which room managers and content creators have and readers, editors and guests do not; an archived room, a section root and a folder the caller cannot write to are all refused, while an unknown folder is answered as missing. A request without filesTitle is rejected as an invalid request, an empty list is accepted and answers with an empty array.

Parameters​

NameInTypeDescriptionNotes
folderIdpathInteger (int32)The folder whose contents the names are tested against; take the id from a listing such as GET api/2.0/files/@root.[required] [example: 1]
CheckUploadRequestbodyCheckUploadRequestThe names to test against the files the folder already holds.[required]

Responses​

Status codeDescriptionTypeResponse headers
200The submitted titles that already belong to a file in the folderStringArrayWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read or has no filesTitle--
403The caller cannot add content to the folder, or a title that is not a PDF is checked against a form-filling room template--
404No folder with the specified ID--
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​

StringArrayWrapper

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 whose contents the names are tested against; take the id from a listing such as `GET api/2.0/files/@root`.[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