Skip to main content

OCRCode

This article explains how to check if a CPF is in a document using the Unico Check REST API.

This method checks if there is a particular CPF in a document that was provided along with the CPF in the request.

How to use it?

Make a POST request to the /documents/ocrcode endpoint

With a valid Access token, make a request to the endpoint (POST/documents/ocrcode) enviando os seguintes parâmetros:

{
"Code": "CPF_Titular",
"Base64Documento": "IMAGEM_DOCUMENTO"
}

Parameters:

  • HEADER PARAMETERS
NameTypeMandatory/OptionalDescription
APIKEYStringMandatoryAPI key
AuthorizationStringMandatoryAccess token
Content-TypeStringMandatory"application/json"
  • REQUEST BODY SCHEMA
NameTypeMandatory/OptionalDescription
codeStringMandatoryCPF válido
Base64DocumentoStringMandatoryFoto do documento. A imagem precisa ser em base64 (png, jpg, jpeg)

Request example:

JSON File
{
"code": "12345678910",
"Base64Documento": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAgSURBVDhPY/wPBAwUACYoTTYYNWDUABAYNWDgDWBgAABrygQclUTopgAAAABJRU5ErkJggg=="
}

Successful request

If the request was executed successfully, the return response is a JSON containing the status of the query as follows:

{
"Status": true
}

Request error

If an error occurs, the return response is a JSON containing the error code and description:

{
"Error": {
"code": "40004",
"description": "Error description"
}
}

For more information on the errors returned, see the list available in the article Response Errors.

Any concerns?

Missing something or still need help? If you are already a customer or partner, you can contact us through the Help Center.