Skip to main content

isFormPDF

BooleanWrapper isFormPDF(fileId)

GET /api/2.0/files/file/{fileId}/isformpdf

Check the PDF file

Tells whether a file is a PDF form that can be filled out in the portal, and answers with a single boolean. The check is by content, not by extension: the beginning of the file is read and the answer is true only when it carries the marker the editors write into the forms they produce, so an ordinary PDF, and a PDF form made in other software, both answer false. A file whose name is not a PDF at all answers false without being read. Use it before offering the form-filling operations on a file, because a document that answers false cannot be started for filling. The caller needs read access to the file, and read access is enough - a member of the room with read-only rights gets the answer; a caller without access to the room is refused and an anonymous caller is rejected. The operation is read-only and idempotent. It says nothing about the state of the filling - for that read GET api/2.0/files/file/{fileId}/formroles.

Parameters​

NameInTypeDescriptionNotes
fileIdpathInteger (int32)The file the operation addresses. Take the identifier from a listing such as GET api/2.0/files/{folderId}: a file stored on the portal is numbered, while a file in a connected third-party account is named by an opaque string.[required] [example: 10]

Responses​

Status codeDescriptionTypeResponse headers
200True when the file is a PDF form made in the editors, false otherwiseBooleanWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
403The caller cannot read the file--
404The file id resolves to nothing--
500The file is a PDF form in a form-filling room whose filling has not started, and the caller may only fill forms there--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
400Bad Request.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​

BooleanWrapper

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
fileIdpathStringThe file the operation addresses. Take the identifier from a listing such as `GET api/2.0/files/{folderId}`: a file stored on the portal is numbered, while a file in a connected third-party account is named by an opaque string.[required] [example: sbox-42-L1JlcG9ydC5kb2N4]

Authorization​

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

HTTP request headers​

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