Skip to main content
Version: 1.17.1 (latest)

Getting started

All available face recognition operations with OMNI Platform objects (such as Profiles, Profile Groups, Samples, etc.) can be performed using Integration API. Access to API is enabled via GraphQL — an open-source API data query and manipulation language and a runtime for running existing data queries. With GraphQL you can send requests to OMNI Platform and receive the requested data that can be integrated into your client application. For more information about GraphQL see the following sources:

To get started with API, sign in to OMNI Platform account. If you have no account, go to Sign Up page.

To use Integration API in your application, add Token to HTTP request header and send request to the https://cloud.3divi.ai/api/v2/. To get the token, follow the instructions below:

  1. Open GraphQL interactive console by clicking Platform API button at Resources widget of Admin panel.

  2. Copy the request below to the console and click Execute Query button.

    query{
    me {
    workspaces {
    accesses {
    id
    }
    }
    }
    }
  3. As a result, GraphQL returns the response with a token (id):

    {
    "data": {
    "me": {
    "workspaces": [
    {
    "accesses ": [
    {
    "id": "3460***"
    }
    ]
    }
    ]
    }
    }
    }
note

The user registered with PLATFORM_DEFAULT_EMAIL can get API access token via a command:

./cli.sh platform get-token - <platform_host> <user_email>

cURL requests

Except for GraphQL you can send the requests using cURL. cURL template for sending API requests is given below:

curl --location --request POST "<url>" --header "token: <your access token>" --header "Content-Type: application/json" --data-raw "{\"query\":\"<GraphQL query or mutation>\",\"variables\":{<GraphQL variables>}}"

<url> — URL of your server

<your access token> — note that your cURL requests will not be sent without access token.

Example cURL request: This request is used to get a list of first 5 profiles from the database.

curl --location --request POST "<IntegrationAPIUrl/>" --header "token: 3e357***" --header "Content-Type: application/json" --data-raw "{\"query\":\"query {profiles(limit: 5, offset: 0) {totalCount, collectionItems {id, info}}}\",\"variables\":{}}"

API returns the following result:

{
"data": {
"profiles": {
"totalCount": 5,
"collectionItems": [
{
"id": "195ed5fe-580e-476f-8496-befdb0003d85",
"info": {
"age": 46,
"gender": "MALE",
"avatar_id": "9945328f-ebd8-4683-bde5-25284686f439",
"main_sample_id": "83800c22-5ed3-4c9f-91bf-ce79c0de747a"
}
},
{
"id": "8d46bf22-5d24-4e4f-bfd3-e215cbde53f0",
"info": {
"age": 24,
"gender": "FEMALE",
"avatar_id": "1e7c8293-75e8-485a-8861-415eec854011",
"main_sample_id": "6cbd4c9a-7cd0-4c43-9561-387be9dff6f3"
}
},
{
"id": "944ab599-bd6d-47bf-b8e3-ed201a4e6530",
"info": {
"age": 31,
"gender": "MALE",
"avatar_id": "9f36bee0-efdf-42fc-a059-c60d5c7e6da9",
"main_sample_id": "db9998a4-4331-41b5-9abd-30499b881be8"
}
},
{
"id": "aa40fb31-96d3-421b-96ae-05566fc57bee",
"info": {
"age": 35,
"gender": "MALE",
"avatar_id": "ae61ec9f-2953-4f24-86d8-7718df6f9ff5",
"main_sample_id": "33a72136-175b-4361-8444-e1e0c4ce04d4"
}
},
{
"id": "c5e1b7d9-b446-4739-a3d0-a8cf8d717c70",
"info": {
"age": 21,
"gender": "MALE",
"avatar_id": "9938407f-d101-4005-8d30-4b1ce8319bc7",
"main_sample_id": "f2b3d23a-6f73-4d9b-97aa-13edaf5e82f7"
}
}
]
}
}
}