Read Identities by dni
Dado un listado de dnis, este endpoint retorna cada persona (si es que la encuentra) registrada en el servicio.
Endpoint
Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {{access_token}} | access_token obtained in Atenea |
Endpoint:
Method: GET
URL: https://api.trust.lat/identification/api/v1/identity/:dni
caution
Recuerda que para utilizar este endpoint es necesario un access token obtenido en el servicio Atenea
Body
{
"dnis": ["17310594-5", "201949739-9"]
}
Code Examples
- Curl
- JavaScript
- Python
curl --location --request POST 'https://api.trust.lat/identification/api/v1/identity/dni' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{accessToken}}' \
--data-raw '{
"dnis": ["17310594-5", "201949739-9"]
}'
import requests
url = "https://api.trust.lat/identification/api/v1/identity/dni"
payload="{\n\t\"dnis\": [\"17310594-5\", \"201949739-9\"]\n}"
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{accessToken}}'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var data = JSON.stringify({"dnis":["17310594-5","201949739-9"]});
var config = {
method: 'post',
url: 'https://api.trust.lat/identification/api/v1/identity/dni',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{accessToken}}'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Responses
HTTP Code: 200 OK
{
"status": true,
"message": "ok",
"user": [
{
"id": 2,
"dni": "123456789-0",
"name": "Juan",
"lastname": "Perez",
"email": "jperez@correo.com",
"phone": "+56912234567",
"created_at": "2019-05-04T02:30:14.108Z",
"updated_at": "2021-01-30T02:12:02.547Z",
"status": true,
"uuid": "z10b8a62-ab41-4a6b-aa31-87f795181db",
"apple_users_id": [
"1111-2222-3333-5555",
"111.2222.3333"
]
},
{
"id": 2,
"dni": "13234567-3",
"name": "Pedro",
"lastname": "Rojas",
"email": "projas@correo.com",
"phone": "+56912345678",
"created_at": "2019-05-04T02:30:14.108Z",
"updated_at": "2021-01-30T02:12:02.547Z",
"status": true,
"uuid": "50bve62-a911-4a6b-aa31-8af791813db",
"apple_users_id": []
}
]
}
HTTP Code: 404 Not Found
{
"status": false,
"message": "Array 'dnis' not found"
}