Skip to main content

PDF Document Upload

Usage

This method should be used to upload documents in PDF format.

Request

ENDPOINT
/document
MÉTODO
POST

Request Body Params

The following data must be sent as form-data in the request body:

FieldTypeDescriptionRequired
filefileBinary file of the document to be uploaded.YES
control_numberstringFree field that can be used for control or external reference purposes.NO
endorsement_pagebooleanIf set to true, an Endorsement Page will be added.NO
endorser_namestringName of the endorser on the endorsement page.NO
endorser_document_numberstringDocument number of the endorser on the endorsement page.NO
receiver_namestringName of the receiver on the endorsement page.NO
receiver_document_numberstringDocument number of the receiver on the endorsement page.NO
document_identifierstringDocument identifier on the endorsement page.NO
document_typestringType of document on the endorsement page.NO

Response

STATUS
200
Response Body
[
{
"control_number": "1123",
"document_key": "d559e3dc-d19c-494e-b02e-b7199e5325ea",
"file_size": 1679,
"name": "document.pdf",
"url": "https://storage.googleapis.com/certifier-api-storage-sandbox/d559e3dc-d19c-494e-b02e-b7199e5325ea/teste_of_original.pdf"
},
]

STATUS
400
Response Body
{
"title": "Bad Request",
"description": "Document size larger than 20 MB"
}
Response Body
{
"title": "Bad Request",
"description": "PDF has editable format fields"
}
Response Body
{
"title": "Bad Request",
"description": "PDF file can't have a password."
}

Request de Exemplo

curl --location 'https://api.certifiqi.com.br/document' \
--header 'x-api-token: chave de api' \
--form 'file=@"/seu_arquivo.pdf"' \
--form 'endorsement_page="true"' \
--form 'endorser_name="Endorser"' \
--form 'endorser_document_number="123456789112"' \
--form 'receiver_name="Receiver"' \
--form 'receiver_document_number="123456789113"' \
--form 'document_type="Termo de Cessão"' \
--form 'document_identifier="1234"' \
--form 'control_number="999"'

Adding the Endorsement Page

To add a black endorsement page at the end of the uploaded PDF, the following fields must be provided:

  • endorsement_page set to True
  • endorser_name
  • endorser_document_number
  • receiver_name
  • receiver_document_number
  • document_identifier
  • document_type

When these fields are sent, the added endorsement text will follow the format below:

The institution endorser_name, registered under CNPJ number endorser_document_number, endorses this document_type number document_identifier to receiver_name, registered under CNPJ number receiver_document_number, pursuant to the applicable legislation, especially paragraph 1 of article 29 of Law No. 10,931, dated August 2, 2004, aiming to transfer full ownership to the institution indicated herein.
This endorsement is performed electronically, and the parties hereby agree and acknowledge the validity of its electronic signature, pursuant to paragraph 2 of article 10 of Provisional Measure No. 2,200, dated August 24, 2001, or any regulation that may replace it.