Backend flow

Android, IOS and web applications will be able to directly send images to ClearDil service.

To be able to do so, preparation steps are required on the backend side.

1. Obtain an API token
In order to start integration, you will need an API token. You can use our sandbox environment to test your integration.

Retrieve your API token in ClearDil Dashboard Settings/API page.

2. Create a customer
The first step in creating any check is to create a customer from your backend server, using a valid API token.

For Document and Facial Similarity Photo reports, you must at least specify the customer's first and last names in the body of the request.

Example customer creation request:

curl -X POST https://api.cleardil.com/v1/customers \
  -H 'Authorization: Bearer <YOUR_API_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
  "type" : "INDIVIDUAL",
  "email": "briandoe@email.com",
  "first_name": "Brian",
  "last_name": "Doe"
}'

Example response:

{
  "email": "briandoe@email.com",
  "type": "INDIVIDUAL",
  "first_name": "Brian",
  "last_name": "Doe",
  "id": "e24ae42c-6882-4fe5-9b2c-0a678e82c6fb"
}

3. Generate an SDK token

Use your API token to make a request to the 'generate SDK token' endpoint, using the customer ID you created in the previous step.

Example SDK token request:

curl -X POST https://api.cleardil.com/v1/sdk/token \
  -H 'Authorization: Bearer ' \
  -H 'Content-Type: application/json' \
  -d '{
     "customer": "<CUSTOMER_ID>"
   }'

With our previous example, <CUSTOMER_ID> would be replaced by e24ae42c-6882-4fe5-9b2c-0a678e82c6fb