Get Authenticated
IREX servers respond only to HTTP requests from authenticated API users. Such users get API tokens to include in their requests' headers, thus letting IREX know about their identity.
Initial Authentication
Send a request ...
|
|
POST Request Sample |
| /oath2/v1/auth/authenticate | |
... holding the body of:
{
"name": "string",
"password": "string",
"one_time_password": "string",
"rememberme": true
}
Where:
|
name Required |
string |
Platform user's login |
|
password REQUIRED |
string
|
Platform user's passcode
|
For example, it might be ...
curl -X 'POST' \
'https://vg.irex.ai/oauth2/oauth2/v1/auth/authenticate' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"password": "string",
"one_time_password": "string",
"rememberme": true
}'
Unless an authentication error occurs, the response comes in:
{
"access_token": "string",
"refresh_token": "string"
}
Copy the access_token to reuse it in the headers of the next requests, e.g. like this:
curl -X 'GET' \
'https://vg.irex.ai/face-manager/api/v1/face-lists?text=string&exclude_user_group_id=0&exclude_entity_group_id=0&limit=1&offset=0&pageable_sort[empty]=true&pageable_sort[unsorted]=true&pageable_sort[sorted]=true&can_i_manage=true' \
-H 'accept: */*' \
-H 'Authorization: Bearer <access_token>'
Regular Updating of the Tokens
The tokens stay valid within a limited time period defined in Platform settings. Those settings are unavailable to an external user, so update the tokens periodically to stay permanently connected to IREX. To do so, run the request ...
|
|
POST Request Sample |
| /oath2/v1/auth/refresh | |
The body of the request contains ...
{
"refresh_token": "string"
}
... where refresh_token is the currently valid value.
If successful, the request returns the new values:
{
"access_token": "string",
"refresh_token": "string"
}