Authorization Using Submission Token

Welcome to our new API version 2.0. If you are migrating or currently using api.cloud.nodeflux.id please make sure to use api.identifai.id. Please check the migration guideline for migrating.
A submission token is a one-time authorization token to request Nodeflux service analytics. The submission token must be included in the header of all requests made to the API request. The token will expire in 5 minutes.

Implementation

Generate Submission Token

To generate the submission token, Send a request using a POST method to the endpoint:
{{identifai_base_url}}/auth/v1/submission_tokens
Request Header
Parameter
Value
Authorization
Using HMAC Token*
x-nodeflux-timestamp
X-nodeflux-timestamp value from signature request
Request Body: null
Response Example
{
"ok": true,
"submission_token": "9268e8f3-1c2e-4b39-8604-61fe30a29908-GXYDEMJNGA4S2MRS"
}
*Please check here how to generate Hmac Token for authorization

Request Analytics

When requesting analytics API, the authorization token must be included in the header. Send POST method on Asynchronous API endpoint
Request Header
Parameter
Value
Authorization
Your Submission Token
For The request body, please follow each analytics API. Here, we give you an example using face liveness API.
Example Requesting Face Liveness API
Endpoint:{{identifai_base_url}}/v1/analytics/face-liveness

Request Body

{
"images": [
"{INSERT_JPEG_IMAGE_AS_BASE64_STRING_FOR_YOUR_SELFIE}"
]
}

Response

{
"job_id": "<job_id>",
"ok": true
}

Get job result

Send a GET request to get the analytics result with an empty body request, using the endpoint:
{{identifai_base_api}}/v1/jobs/{{your_job_id}}
Request Header:
Parameter
Value
Authorization
Your Submission Token

Example Requesting Result of Face Liveness API

Endpoint:
{{identifai_base_api}}/v1/jobs/{{your_job_id}}e0fd0da09411f2386acc343bb58e802d88c2bd6f6d22ea98GIYDEMJNGEYC2MBX
Body Request: null
Response Example:
{
"job": {
"id": "e0fd0da09411f2386acc343bb58e802d88c2bd6f6d22ea98GIYDEMJNGEYC2MBX",
"result": {
"status": "success",
"analytic_type": "FACE_LIVENESS",
"result": [
{
"face_liveness": {
"live": false,
"liveness": 0.9294614851474762
}
}
]
}
},
"message": "Face Liveness Underqualified",
"ok": true
}

Error Response

Description
Error Response
Expired Submission Token
{"code":"not-authenticate","errors":[],"message":"Submission token is expired","ok":false}
Submission Token has been used
{"code":"not-authenticate","errors":[],"message":"Submission token is already used","ok":false}