How to Issue a Service Token
1
Step 1
Example request
curl -L 'https://{{host}}/api/authorize/auth' \
-H 'Content-Type: application/json' \
--data-raw '{
"credentials": {
"email": "[email protected]",
"password": "your_admin_password"
}
}'Example response
{
…
"user": {
"user_type": "ADMIN",
…
},
"access_token": "<token>",
…
}2
Step 2 (optional)
Example request
curl -L 'https://{{host}}/api/companies/'
-H 'X-Forensic-Access-Token: token_id'
-H 'Content-Type: application/json'
-d '{ "name": "your_company_name" }'Example response
{
"company_id": "company_id",
"name": "your_company_name",
"in_deletion": false,
"technical_meta_data": {}
}3
Step 3
Example request
curl -L 'https://{{host}}/api/users/'
-H 'X-Forensic-Access-Token: token_id'
-H 'Content-Type: application/json'
--data-raw '{
"credentials": {
"email": "<[email protected]>",
"password": "<your_service_user_password>"
},
"profile": {
"company_id": " company_id",
<!-- the next line is for API 6 -->
"user_type": "CLIENT_SERVICE",
"first_name": "first_name",
"last_name": "last_name",
"middle_name": "",
"is_admin": false,
<!-- the next line is for API 5 and below -->
"is_service": true,
"can_start_analyse_biometry": true,
"can_start_analyse_collection": true,
"can_start_analyse_documents": true,
"can_start_analyse_quality": true
}
}Example response
{
"user_id": "user_id",
"user_type": "CLIENT_SERVICE",
…
"is_active": true,
…
"is_service": true
}API 6
{
"credentials": {
"email": " <[email protected]> ",
"password": "your_client_service_user_password"
},
"profile": {
"company_id": "{{company_id}}",
"user_type": "CLIENT_SERVICE",
"first_name": "john",
"last_name": "doe",
"middle_name": "",
"can_start_analysis_biometry": true,
"can_start_analysis_collection": true,
"can_start_analysis_documents": true,
"can_start_analysis_quality": true
}
}
API 5 and below
{
"credentials": {
"email": "[email protected]",
"password": "your_client_service_user_password"
},
"profile": {
"company_id": "{{company_id}}",
"user_type": "CLIENT",
"first_name": "john",
"last_name": "doe",
"middle_name": "",
"is_admin": false,
"is_service": true,
"can_start_analyse_biometry": true,
"can_start_analyse_collection": true,
"can_start_analyse_documents": true,
"can_start_analyse_quality": true
}
}4
Step 4
Example request
curl -L 'https://{{host}}/api/authorize/service_token/{{user_id}}' \
-H 'X-Forensic-Access-Token: token_id' \
-H 'Content-Type: application/json'Example response
{
"token_id": "token_id",
"user_id": "user_id",
"access_token": "service_token",
"expire_date": 1904659888.282587,
"session_id": 0
}Last updated
Was this helpful?
