Get User By Email v2
Este endpoint permite recuperar los datos de un usuario haciendo ingreso de su correo.
Endpoint
Headers
Key | Value | Description |
---|---|---|
Authorization | Bearer {{access_token}} | access_token obtained in Atenea |
Method: POST
URL: https://atenea.trust.lat/users/email
Body Variables:
Key | Value Example | Description |
---|---|---|
email.example@gmail.com | Correo perteneciente a un usuario. Obligatorio. |
caution
Recuerda que para utilizar este endpoint es necesario un access token obtenido en el servicio Atenea.
Body
{
"email": "email.example@gmail.com"
}
Code Examples
- Curl
- JavaScript
- Python
curl --location --request POST 'https://atenea.trust.lat/users/email' \
--header 'Authorization: Bearer `{{access_token}}`' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "email.example@gmail.com"
}'
import requests
url = "https://atenea.trust.lat/users/email"
payload="{\n \"email\": \"email.example@gmail.com\"\n}"
headers = {
'Authorization': 'Bearer `{{access_token}}`',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var data = JSON.stringify({"email":"email.example@gmail.com"});
var config = {
method: 'post',
url: 'https://atenea.trust.lat/users/email',
headers: {
'Authorization': 'Bearer `{{access_token}}`',
'Content-Type': 'application/json'
},
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": 1,
"email": "email.example@gmail.com",
"created_at": "2019-03-25T02:52:07.343Z",
"updated_at": "2020-08-26T18:45:12.206Z",
"dni": "20123123-4",
"phone_number": "+56912345678",
"name": "Pedro",
"last_name": "Perez",
"company_uid": "1",
"status": true,
"img": "",
"nationality": "CHL",
"load_uuid": "",
"confirmed": true
}
}
HTTP Code: 404 Not Found - User Not Found.
{
"status": false,
"message": "Not found"
}
HTTP Code: 404 Not Found - Field Email Not Found.
{
"status": false,
"message": "Field email not found"
}