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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
APIKEY | String | Mandatory | API key |
Authorization | String | Mandatory | Access token |
Content-Type | String | Mandatory | "application/json" |
- REQUEST BODY SCHEMA
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
code | String | Mandatory | CPF válido |
Base64Documento | String | Mandatory | Foto do documento. A imagem precisa ser em base64 (png, jpg, jpeg) |
Request example:
{
"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.