Activate Profile
Este endpoint permite cambiar el estado de un perfil de usuario, activando un usuario previamente deshabilitado, permitiendo nuevamente el uso del perfil para própositos de login, cambio de contraseña y otras operaciones.
Endpoint
Headers
Key | Value | Description |
---|---|---|
Content-Type | application/json | |
Authorization | Bearer {{access_token}} | access_token obtained in Atenea |
Method: PATCH
URL: https://api.trust.lat/trust-idp/v1/companies/:company_id/profiles/:uuid/status
Path Variables:
Key | Value Example | Description |
---|---|---|
company_id | -1 | Identificador de la compañia, provisto por la empresa Trust. Obligatorio |
uuid | ffffffff-ffff-ffff-ffff-ffffffffffff | Identificador único del perfil de usuario. Obligatorio. |
caution
Recuerda que para utilizar este endpoint es necesario un access token obtenido en el servicio Atenea.
Body
Fields
- operation: Parámetro utilizado para específicar la operación a ejecutar. Debe tener por valor activate para este endpoint. Obligatorio.
Code Examples
- Curl
- JavaScript
- Python
curl --location --request PATCH 'https://api.trust.lat/trust-idp/v1/companies/:company_id/profiles/:uuid/status' \
--header 'Authorization: Bearer `{{access_token}}`' \
--header 'Content-Type: application/json' \
--data-raw '{
"operation": "activate"
}'
import requests
import json
url = "https://api.trust.lat/trust-idp/v1/companies/:company_id/profiles/:uuid/status"
payload = json.dumps({
"operation": "activate"
})
headers = {
'Authorization': 'Bearer `{{access_token}}`',
'Content-Type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var data = JSON.stringify({
"operation": "activate"
});
var config = {
method: 'patch',
url: 'https://api.trust.lat/trust-idp/v1/companies/:company_id/profiles/:uuid/status',
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
Profile Activated Succesfully
{
"code": 200,
"resource": "Profile",
"data": {
"active": true,
"uuid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"nin": "123456789",
"username": "tlat",
"phone_number": "+56912345678",
"email": "tlat@email.com",
"name": "test",
"lastname": "latin",
"birthday": null,
"nationality": null,
"timezone": null,
"trusted_fields": {},
"field_expiration_time": {},
"two_factor_authentication": [],
"identification_provider": "test_idp"
},
"message": "Activated"
}
HTTP Code: 401 Unauthorized
Invalid Token
{
"status": 401,
"error": "Invalid or expired token"
}
HTTP Code: 403 Forbidden
Failed Validation
{
"code": 403,
"message": "Forbidden"
}
HTTP Code: 404 Not Found
Profile Not Found
{
"code": 404,
"resource": "Profile",
"message": "Not found"
}
HTTP Code: 409 Conflict
Profile Already Active
{
"code": 409,
"resource": "Profile",
"message": "Conflict",
"errors": "Profile is already active"
}