Authorization Using Submission Token
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:
Request Header
Parameter
Value
Authorization
Using HMAC Token*
x-nodeflux-timestamp
X-nodeflux-timestamp value from signature request
Request Body: null
Response Example
1
{
2
"ok": true,
3
"submission_token": "9268e8f3-1c2e-4b39-8604-61fe30a29908-GXYDEMJNGA4S2MRS"
4
}
Copied!

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
Request Body
1
{
2
"images": [
3
"{INSERT_JPEG_IMAGE_AS_BASE64_STRING_FOR_YOUR_SELFIE}"
4
]
5
}
Copied!

Get job result

Send GET request to get the analytics result, using endpoint:
Request Header:
Parameter
Value
Authorization
Your Submission Token

Example Requesting Result of Face Liveness API

Endpoint:
https://api.cloud.nodeflux.io/v1/jobs/e0fd0da09411f2386acc343bb58e802d88c2bd6f6d22ea98GIYDEMJNGEYC2MBX
Body Request: null
Response Example:
1
{
2
"job": {
3
"id": "e0fd0da09411f2386acc343bb58e802d88c2bd6f6d22ea98GIYDEMJNGEYC2MBX",
4
"result": {
5
"status": "success",
6
"analytic_type": "FACE_LIVENESS",
7
"result": [
8
{
9
"face_liveness": {
10
"live": false,
11
"liveness": 0.9294614851474762
12
}
13
}
14
]
15
}
16
},
17
"message": "Face Liveness Underqualified",
18
"ok": true
19
}
Copied!

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}
Last modified 11d ago