NAV

{title}
{version}

About

{title} - {description}

Admin panel Person OAuth panel Swagger docs Tech docs

Registration

To register a new client to use {title} you should send the following data

Field Desc Example
client_id Client ID example_client_id
client_secret Client secret tGwXSHpsPwj8UNbS
client_name Client name Example Client Org
service Specific service {urls_base}

Getting Started

Simple steps showing examples of using {title}

Get a client token

To get a client token replace the keys use this code

curl --location --request POST '{urls_base}/auth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=<your_client_id>' \
--data-urlencode 'client_secret=<your_client_secret>'
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "{urls_base}/auth/token"
  method := "POST"

  payload := strings.NewReader("grant_type=client_credentials&client_id=<your_client_id>&client_secret=<your_client_secret>")

  client := &http.Client {}
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }

  req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }

  fmt.Println(string(body))
}
var client = new RestClient("{urls_base}/auth/token");
client.Timeout = -1;

var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("grant_type", "client_credentials");
request.AddParameter("client_id", "<your_client_id>");
request.AddParameter("client_secret", "<your_client_secret>");

IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);
<?php
require_once 'HTTP/Request2.php';

$request = new HTTP_Request2();
$request->setUrl('{urls_base}/auth/token');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/x-www-form-urlencoded'
));
$request->addPostParameter(array(
  'grant_type' => 'client_credentials',
  'client_id' => '<your_client_id>',
  'client_secret' => '<your_client_secret>'
));

try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var urlencoded = new URLSearchParams();
urlencoded.append("grant_type", "client_credentials");
urlencoded.append("client_id", "<your_client_id>");
urlencoded.append("client_secret", "<your_client_secret>");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: urlencoded,
  redirect: 'follow'
};

fetch("{urls_base}/auth/token", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

The client token is required for requests from the client

To get a client token you need to send a POST request to {urls_base}/auth/token with application/x-www-form-urlencoded data

Key Desc Example
grant_type OAuth grant for client credentials client_credentials
client_id Client ID example_client_id
client_secret Client secret tGwXSHpsPwj8UNbS

Response

{
    "access_token": "<your_client_token>",
    "token_type": "bearer",
    "expires_in": "15552000"
}

The response will return a JSON structure containing the fields

Key Desc Example
access_token JWT token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
eyJjaWQiOiJ0ZXN0X2NsaWVudF8xIiwiZXhwIjoxNjY4MjU5N
Tk2LCJuYmYiOjE2NTI3MDc1OTYsInR5cGUiOiJjbGllbnQifQ.
bZaNVf7v-hchzDv7ULG__NS3DIfjbA8s-lfDqGMryco
token_type Token type bearer
expires_in Token lifetime in seconds 15552000

JWT Payload

{
    "cid": "<your_client_id>",
    "exp": 1668259596,
    "nbf": 1652707596,
    "type": "client"
}

The payload of JWT token contains the fields

Key Desc Example
cid Client ID example_client_id
exp Expiration time 1668259596
nbf Not before 1652707596
type Token type client

Add a new person

To add a new person replace the keys and use this code

curl --location --request POST '{urls_base}/api/person' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_client_token>' \
--data-raw '{
  "secret": "<your_secret>",
  "identifiers": [
    {
      "identifier": "<your_email>",
      "date_from": "2000-01-01",
      "verified": 0,
      "identifier_type": "email"
    }
  ]
}'
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "{urls_base}/api/person"
  method := "POST"

  payload := strings.NewReader(`{
    "secret": "<your_secret>",
    "identifiers": [
      {
        "identifier": "<your_email>",
        "date_from": "2000-01-01",
        "verified": 1,
        "identifier_type": "email"
      }
    ]
  }`)

  client := &http.Client {}

  req, err := http.NewRequest(method, url, payload)
  if err != nil {
    fmt.Println(err)
    return
  }

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Authorization", "Bearer <your_client_token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }

  fmt.Println(string(body))
}
var client = new RestClient("{urls_base}/api/person");
client.Timeout = -1;

var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer <your_client_token>");
request.AddParameter("application/json", "{\n  \"secret\": \"<your_secret>\",\n  \"identifiers\": [\n    {\n      \"identifier\": \"<your_email>\",\n      \"date_from\": \"2000-01-01\",\n      \"verified\": 1,\n      \"identifier_type\": \"email\"\n    }\n  ]\n}",  ParameterType.RequestBody);

IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);
<?php
require_once 'HTTP/Request2.php';

$request = new HTTP_Request2();
$request->setUrl('{urls_base}/api/person');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer <your_client_token>'
));
$request->setBody('{\n  "secret": "<your_secret>",\n  "identifiers": [\n    {\n      "identifier": "<your_email>",\n      "date_from": "2000-01-01",\n      "verified": 1,\n      "identifier_type": "email"\n    }\n  ]\n}');

try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer <your_client_token>");

var raw = JSON.stringify({"secret":"<your_secret>","identifiers":[{"identifier":"<your_email>","date_from":"2000-01-01","verified":1,"identifier_type":"email"}]});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{urls_base}/api/person", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

To add a new person you need to add client token to authorization header and send a POST request to {urls_base}/api/person with Person model

Response

{
    "token_type": "bearer",
    "expires_in": "2592000",
    "person_id": "<your_person_id>",
    "access_token": "<your_person_access_token>",
    "refresh_token": "<your_person_refresh_token>"
}

The response will return a JSON structure containing the fields

Key Desc Example
token_type Token type bearer
expires_in Token lifetime in seconds 15552000
person_id Person ID 5471c304-2dd0-4cf1-8370-ef9b26aaaa8a
access_token JWT token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
eyJjaWQiOiJ0ZXN0X2NsaWVudF8xIiwiZXhwIjoxNjU1MzEwNjY4LC
JuYmYiOjE2NTI3MTg2NjgsInBpZCI6IjU0NzFjMzA0LTJkZDAtNGN
mMS04MzcwLWVmOWIyNmFhYWE4YSIsInR5cGUiOiJwZXJzb24ifQ.
8p0UW5ZllnKwIh5V7CJ082a58-cP4yP_uBYhuhZGKSc
refresh_token JWT token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
eyJjaWQiOiJ0ZXN0X2NsaWVudF8xIiwiZXhwIjoxNjU3OTAyNjY4LC
JuYmYiOjE2NTI3MTg2NjgsInBpZCI6IjU0NzFjMzA0LTJkZDAtNGN
mMS04MzcwLWVmOWIyNmFhYWE4YSIsInR5cGUiOiJyZWZyZXNoIn0.
mPulza7HVKGT0yEVClYH_mlz_rdw9dFrBkbDCUbgcPI

JWT Payload

{
    "cid": "<your_client_id>",
    "pid": "<your_person_id>",
    "exp": 1657902668,
    "nbf": 1652718668,
    "type": "person | refresh"
}

The payload of JWT token contains the fields

Key Desc Example
cid Client ID example_client_id
pid Person ID 5471c304-2dd0-4cf1-8370-ef9b26aaaa8a
exp Expiration time 1668259596
nbf Not before 1652707596
type Token type person | refresh

Refresh a person token

To refresh a pair of person tokens replace the keys and use this code

curl --location --request POST '{urls_base}/auth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=refresh_token' \
--data-urlencode 'client_id=<your_client_id>' \
--data-urlencode 'client_secret=<your_client_secret>' \
--data-urlencode 'refresh_token=<your_refresh_token>'
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "{urls_base}/auth/token"
  method := "POST"

  payload := strings.NewReader("grant_type=refresh_token&client_id=<your_client_id>&client_secret=<your_client_secret>&refresh_token=<your_refresh_token>")

  client := &http.Client {}

  req, err := http.NewRequest(method, url, payload)
  if err != nil {
    fmt.Println(err)
    return
  }

  req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }

  fmt.Println(string(body))
}
var client = new RestClient("{urls_base}/auth/token");
client.Timeout = -1;

var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("grant_type", "refresh_token");
request.AddParameter("client_id", "<your_client_id>");
request.AddParameter("client_secret", "<your_client_secret>");
request.AddParameter("refresh_token", "<your_refresh_token>");

IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);
<?php
require_once 'HTTP/Request2.php';

$request = new HTTP_Request2();
$request->setUrl('{urls_base}/auth/token');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/x-www-form-urlencoded'
));
$request->addPostParameter(array(
  'grant_type' => 'refresh_token',
  'client_id' => '<your_client_id>',
  'client_secret' => '<your_client_secret>',
  'refresh_token' => '<your_refresh_token>'
));

try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var urlencoded = new URLSearchParams();
urlencoded.append("grant_type", "refresh_token");
urlencoded.append("client_id", "<your_client_id>");
urlencoded.append("client_secret", "<your_client_secret>");
urlencoded.append("refresh_token", "<your_refresh_token>");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: urlencoded,
  redirect: 'follow'
};

fetch("{urls_base}/auth/token", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

To refresh a pair of person tokens you need to send a POST request to {urls_base}/auth/token with application/x-www-form-urlencoded data

Key Desc Example
grant_type OAuth grant for refresh token refresh_token
client_id Client ID example_client_id
client_secret Client secret tGwXSHpsPwj8UNbS
refresh_token Refresh token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
eyJjaWQiOiJ0ZXN0X2NsaWVudF8xIiwiZXhwIjoxNjU3OTAyNjY4LC
JuYmYiOjE2NTI3MTg2NjgsInBpZCI6IjU0NzFjMzA0LTJkZDAtNGN
mMS04MzcwLWVmOWIyNmFhYWE4YSIsInR5cGUiOiJyZWZyZXNoIn0.
mPulza7HVKGT0yEVClYH_mlz_rdw9dFrBkbDCUbgcPI

Response

{
    "token_type": "bearer",
    "expires_in": "2592000",
    "access_token": "<your_person_access_token>",
    "refresh_token": "<your_person_refresh_token>"
}

The response will return a JSON structure similar to adding a new person with refreshed pair of person tokens

Get a person

To get a person replace the keys and use this code

curl --location --request GET '{urls_base}/api/person' \
--header 'Authorization: Bearer <your_person_token>'
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "{urls_base}/api/person"
  method := "GET"

  client := &http.Client {}

  req, err := http.NewRequest(method, url, nil)
  if err != nil {
    fmt.Println(err)
    return
  }

  req.Header.Add("Authorization", "Bearer <your_person_token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }

  fmt.Println(string(body))
}
var client = new RestClient("{urls_base}/api/person");
client.Timeout = -1;

var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <your_person_token>");

IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);
<?php
require_once 'HTTP/Request2.php';

$request = new HTTP_Request2();
$request->setUrl('{urls_base}/api/person');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer <your_person_token>'
));

try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <your_person_token>");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("{urls_base}/api/person", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

To get a person you need to add person token to authorization header and send a GET request to {urls_base}/api/person

Response

{
    "id": "<your_person_id>",
    "ts": "2000-01-01T01:01:01.000001Z",
    "identifiers": [
        {
            "id": "<your_identifier_id>",
            "identifier": "<your_identifier_email>",
            "identifier_type": "email",
            "verified": 0,
            "date_from": "2000-01-01"
        }
    ]
}

The response will return a JSON structure of person

Edit a person

To edit a person identifer replace the keys and use this code

curl --location --request PUT '{urls_base}/api/person/identifier' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_person_token>' \
--data-raw '{
    "person_id": "<your_person_id>",
    "items": [
        {
            "id": "<your_identifier_id>",
            "identifier": "<your_email>",
            "identifier_type": "email",
            "date_from": "0001-01-01",
            "verified": 0
        }
    ]
}'
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "{urls_base}/api/person/identifier"
  method := "PUT"

  payload := strings.NewReader(`{
      "person_id": "<your_person_id>",
      "items": [
          {
              "id": "<your_identifier_id>",
              "identifier": "<your_email>",
              "identifier_type": "email",
              "date_from": "0001-01-01",
              "verified": 0
          }
      ]
  }`)

  client := &http.Client {}
  
  req, err := http.NewRequest(method, url, payload)
  if err != nil {
    fmt.Println(err)
    return
  }

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Authorization", "Bearer <your_person_token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }

  fmt.Println(string(body))
}
var client = new RestClient("{urls_base}/api/person/identifier");
client.Timeout = -1;

var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer <your_person_token>");
request.AddParameter("application/json", "{\n    \"person_id\": \"<your_person_id>\",\n    \"items\": [\n        {\n            \"id\": \"<your_identifier_id>\",\n            \"identifier\": \"<your_email>\",\n            \"identifier_type\": \"email\",\n            \"date_from\": \"0001-01-01\",\n            \"verified\": 0\n        }\n    ]\n}",  ParameterType.RequestBody);

IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);
<?php
require_once 'HTTP/Request2.php';

$request = new HTTP_Request2();
$request->setUrl('{urls_base}/api/person/identifier');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer <your_person_token>'
));
$request->setBody('{\n    "person_id": "<your_person_id>",\n    "items": [\n        {\n            "id": "<your_identifier_id>",\n            "identifier": "<your_email>",\n            "identifier_type": "email",\n            "date_from": "0001-01-01",\n            "verified": 0\n        }\n    ]\n}');

try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer <your_person_token>");

var raw = JSON.stringify({"person_id":"<your_person_id>","items":[{"id":"<your_identifier_id>","identifier":"<your_email>","identifier_type":"email","date_from":"0001-01-01","verified":0}]});

var requestOptions = {
  method: 'PUT',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{urls_base}/api/person/identifier", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

The Person model does not have mutable fields, but it is possible to change its elements

To edit, for example, an identifier, you need to add person token to authorization header and send a PUT request to {urls_base}/api/person/identifier with Identifier model

Response is empty

Delete a person

To delete a person replace the keys and use this code

curl --location --request DELETE '{urls_base}/api/person' \
--header 'Authorization: Bearer <your_person_token>'
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "{urls_base}/api/person"
  method := "DELETE"

  client := &http.Client {}

  req, err := http.NewRequest(method, url, nil)
  if err != nil {
    fmt.Println(err)
    return
  }

  req.Header.Add("Authorization", "Bearer <your_person_token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }

  fmt.Println(string(body))
}
var client = new RestClient("{urls_base}/api/person");
client.Timeout = -1;

var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <your_person_token>");

IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);
<?php
require_once 'HTTP/Request2.php';

$request = new HTTP_Request2();
$request->setUrl('{urls_base}/api/person');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer <your_person_token>'
));

try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <your_person_token>");

var requestOptions = {
  method: 'DELETE',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("{urls_base}/api/person", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

To delete a person you need to add person token to authorization header and send a DELETE request to {urls_base}/api/person

Response is empty

Features

Additional important parts of {title}

Idempotency

To add idempotency use this code

curl --location --request POST '{urls_base}/api/person' \
--header 'Content-Type: application/json' \
--header 'Idempotence-Key: <your_idempotence_key>' \
--header 'Authorization: Bearer <your_client_token>' \
--data-raw '{
  "secret": "<your_secret>",
  "identifiers": [
    {
      "identifier": "<your_email>",
      "date_from": "2000-01-01",
      "verified": 0,
      "identifier_type": "email"
    }
  ]
}'
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "{urls_base}/api/person"
  method := "POST"

  payload := strings.NewReader(`{
  "secret": "<your_secret>",
  "identifiers": [
    {
      "identifier": "<your_email>",
      "date_from": "2000-01-01",
      "verified": 0,
      "identifier_type": "email"
    }
  ]
}`)

  client := &http.Client {}
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Idempotence-Key", "<your_idempotence_key>")
  req.Header.Add("Authorization", "Bearer <your_client_token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
var client = new RestClient("{urls_base}/api/person");
client.Timeout = -1;

var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Idempotence-Key", "<your_idempotence_key>");
request.AddHeader("Authorization", "Bearer <your_client_token>");
request.AddParameter("application/json", "{\n  \"secret\": \"<your_secret>\",\n  \"identifiers\": [\n    {\n      \"identifier\": \"<your_email>\",\n      \"date_from\": \"2000-01-01\",\n      \"verified\": 0,\n      \"identifier_type\": \"email\"\n    }\n  ]\n}",  ParameterType.RequestBody);

IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{urls_base}/api/person');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/json',
  'Idempotence-Key' => '<your_idempotence_key>',
  'Authorization' => 'Bearer <your_client_token>',
));
$request->setBody('{\n  "secret": "<your_secret>",\n  "identifiers": [\n    {\n      "identifier": "<your_email>",\n      "date_from": "2000-01-01",\n      "verified": 0,\n      "identifier_type": "email"\n    }\n  ]\n}');
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Idempotence-Key", "<your_idempotence_key>");
myHeaders.append("Authorization", "Bearer <your_client_token>");

var raw = JSON.stringify({"secret":"<your_secret>","identifiers":[{"identifier":"<your_email>","date_from":"2000-01-01","verified":0,"identifier_type":"email"}]});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{urls_base}/api/person", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Idempotency - the property of a repeated request to give the same result as the first

For example, if two identical POST requests are sent without an Idempotence-Key, then two elements will be added to the DB. But, if in both requests for the same url there is the same Idempotence-Key with the same request body, then the element will be added to the first request, and not to the second, but the server response in both cases will be similar to adding

It is convenient to use in cases when the response to the first request was not returned - you can send a similar request without fear of adding a duplicate

To use, you need to add a header Idempotence-Key: <your_idempotence_key>

Dictionaries

Dictionaries - languages, element types, etc.

To get identifier types replace the keys and use this code

curl --location --request GET '{urls_base}/api/identifier-type' \
--header 'Authorization: Bearer <your_client_or_person_token>' \
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "{urls_base}/api/identifier-type"
  method := "GET"

  client := &http.Client {}

  req, err := http.NewRequest(method, url, nil)
  if err != nil {
    fmt.Println(err)
    return
  }

  req.Header.Add("IsNewTypes", "true")
  req.Header.Add("Authorization", "Bearer <your_client_or_person_token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
var client = new RestClient("{urls_base}/api/identifier-type");
client.Timeout = -1;

var request = new RestRequest(Method.GET);
request.AddHeader("IsNewTypes", "true");
request.AddHeader("Authorization", "Bearer <your_client_or_person_token>");

IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{urls_base}/api/identifier-type');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'IsNewTypes' => 'true',
  'Authorization' => 'Bearer <your_client_or_person_token>',
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
var myHeaders = new Headers();
myHeaders.append("IsNewTypes", "true");
myHeaders.append("Authorization", "Bearer <your_client_or_person_token>");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("{urls_base}/api/identifier-type", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

For example, to get identifier types, you need to add client token or person token to authorization header and send a GET request to {urls_api}/identifier-type

Response

[
    {
        "type": "phone",
        "regex": "^[0-9]+$",
        "outdated": 0,
        "attributes": {
          "is_required": true,
          "fields": [
            {
              "is_required": true,
              "field": "fieldName",
              "fields": [
                "string"
              ],
              "regex": "string",
              "type": "string"
            }
          ]
        }
    },
    ...
]

The response will return a JSON structure containing the identifier types

Logs

To get identifier logs replace the keys and use this code

curl --location --request GET '{urls_base}/api/log?identifier_id=<your_identifier_id>' \
--header 'Authorization: Bearer <your_person_token>' \
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "{urls_base}/api/log?identifier_id=<your_identifier_id>"
  method := "GET"

  client := &http.Client { }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }

  req.Header.Add("Authorization", "Bearer <your_person_token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
var client = new RestClient("{urls_base}/api/log?identifier_id=<your_identifier_id>");
client.Timeout = -1;

var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <your_person_token>");

IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{urls_base}/api/log?identifier_id=<your_identifier_id>');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer <your_person_token>',
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <your_person_token>");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("{urls_base}/api/log?identifier_id=<your_identifier_id>", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

You can get logs of the whole person or individual elements

For example, to get identifier logs, you need to add person token to authorization header and send a GET request to {urls_api}/log with get parameters

Response

{
    "limit": 20,
    "offset": 0,
    "total": 1,
    "start": 0,
    "end": 1655590000,
    "items": [
        {
            "id": "<your_identifier_id>",
            "operation": "i",
            "actor": "<client>",
            "ts": "<time>",
            "actions": [
                {
                    "id": "<log_id>",
                    "field": "verified",
                    "before": null,
                    "after": "1"
                },
                ...
            ]
        }
    ]
}

The response will return a JSON structure containing logs

State logs

To get identifier state logs replace the keys and use this code

curl --location --request GET '{urls_base}/api/statelog?identifier_id=<your_identifier_id>' \
--header 'Authorization: Bearer <your_person_token>' \
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "{urls_base}/api/statelog?identifier_id=<your_identifier_id>"
  method := "GET"

  client := &http.Client { }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }

  req.Header.Add("Authorization", "Bearer <your_person_token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
var client = new RestClient("{urls_base}/api/statelog?identifier_id=<your_identifier_id>");
client.Timeout = -1;

var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <your_person_token>");

IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{urls_base}/api/statelog?identifier_id=<your_identifier_id>');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Bearer <your_person_token>',
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <your_person_token>");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("{urls_base}/api/statelog?identifier_id=<your_identifier_id>", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Working with state logs is similar to logs, but the difference is that logs will return only changes, while state logs will return the entire model (state) that was obtained at that time

You can get state logs of the whole person or individual elements

For example, to get identifier state logs, you need to add person token to authorization header and send a GET request to {urls_api}/statelog with get parameters

Response

{
    "limit": 20,
    "offset": 0,
    "total": 1,
    "start": 0,
    "end": 1655590000,
    "items": [
        {
            "id": "<your_identifier_id>",
            "operation": "i",
            "actor": "<client>",
            "ts": "<time>",
            "state": {
                "id": "<your_identifier_id>",
                "identifier": "<your_identifier>",
                "identifierType": "email",
                "dateFrom": "2000-01-01",
                "dateTo": null,
                "personId": "<your_person_id>",
                "deleted": "0",
                "verified": "1",
                "attributes": null
            }
        }
    ]
}

The response will return a JSON structure containing state logs

Client persons

To get filtered persons you currently have access to replace the keys and use this code

curl --location --request POST '{urls_base}/api/client/persons' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_client_token>' \
--data-raw '{
    "identifiers": ["<your_identifier>"]
}'
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "{urls_base}/api/client/persons"
  method := "POST"

  payload := strings.NewReader(`{
    "identifiers": ["<your_identifier>"]
  }`)

  client := &http.Client {}
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Authorization", "Bearer <your_client_token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
var client = new RestClient("{urls_base}/api/client/persons");
client.Timeout = -1;

var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer <your_client_token>");
request.AddParameter("application/json", "{\n    \"identifiers\": [\"<your_identifier>\"]\n}",  ParameterType.RequestBody);

IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{urls_base}/api/client/persons');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer <your_client_token>'
));
$request->setBody('{\n    "identifiers": ["<your_identifier>"]\n}');
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer <your_client_token>");

var raw = JSON.stringify({"identifiers":["<your_identifier>"]});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{urls_base}/api/client/persons", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

To get filtered persons you currently have access you need to add client token to authorization header and send a POST request to {urls_base}/api/client/persons with JSON filter model

Response

{
    "limit": 20,
    "offset": 0,
    "total": 1,
    "start": 0,
    "end": 1655700000,
    "items": [
        {
            "id": "<your_person_id>",
            "ts": "<your_person_timestamp>",
            "identifiers": [
                {
                    "id": "<your_identifier_id>",
                    "identifier": "<your_identifier>",
                    "identifier_type": "email",
                    "verified": 1,
                    "date_from": "2000-01-01"
                }
            ]
        }
    ]
}

The response will return a JSON structure containing filtered persons

OAuth

OAuth is an authorization scheme that allows the client grant an access to a personal data without the need to send person credentials to the client

To gain access to a person already added to {title}, you must generate a link leading to the site and provide it to the person

The link is a {urls_auth}/authorize with parameters added

Field Desc Default Example Required
response_type Authorization type <nil> code +
client_id Client ID <nil> example_client_id +
scope Requested permissions <nil> i_email,n_alias +
redirect_uri Link to redirect person after authorization on the client’s site <nil> | <single uri> http://example.com/callback + | -
state The value used to associate the generated link with returning the person on the redirect_uri <nil> yhbfb0tc0SuVjNmy -
reg_uri Link to registration person on the client’s site <nil> http://example.com/registration -
force_scope Mandatory requested permissions <nil> i_email,n_alias -
force_auth Force show the permission selection step false true | false -
lang Site language {lang} en | ka | ru -

After providing the link, the person will go through the stages of authentication, authorization etc. and return back on the client redirect_uri with parameters

Field Desc Example
code Code for getting a person token 8ac981f9-35f4-481b-a24d-b6dadee8bf18
request_scope Requested permissions i_email,n_alias
request_force_scope Mandatory requested permissions i_email,n_alias
scope Received permissions i_email,n_alias
state The value used to associate the generated link with returning the person on the redirect_uri yhbfb0tc0SuVjNmy

Use a code

To exchange the code for a person token use this code

curl --location --request POST '{urls_base}/auth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'code=<your_code>' \
--data-urlencode 'client_id=<your_client_id>' \
--data-urlencode 'client_secret=<your_client_secret>'
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "{urls_base}/auth/token"
  method := "POST"

  payload := strings.NewReader("grant_type=authorization_code&code=<your_code>&client_id=<your_client_id>&client_secret=<your_client_secret>")

  client := &http.Client {}
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }

  req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
var client = new RestClient("{urls_base}/auth/token");
client.Timeout = -1;

var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("grant_type", "authorization_code");
request.AddParameter("code", "<your_code>");
request.AddParameter("client_id", "<your_client_id>");
request.AddParameter("client_secret", "<your_client_secret>");

IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{urls_base}/auth/token');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/x-www-form-urlencoded',
));
$request->addPostParameter(array(
  'grant_type' => 'authorization_code',
  'code' => '<your_code>',
  'client_id' => '<your_client_id>',
  'client_secret' => '<your_client_secret>'
));

try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var urlencoded = new URLSearchParams();
urlencoded.append("grant_type", "authorization_code");
urlencoded.append("code", "<your_code>");
urlencoded.append("client_id", "<your_client_id>");
urlencoded.append("client_secret", "<your_client_secret>");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: urlencoded,
  redirect: 'follow'
};

fetch("{urls_base}/auth/token", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

To exchange the code for a person token you need to send a POST request to {urls_auth}/token with application/x-www-form-urlencoded data

Key Desc Example Required
code Code for getting a person token 8ac981f9-35f4-481b-a24d-b6dadee8bf18 +
grant_type OAuth grant for authorization code authorization_code +
client_id Client ID example_client_id +
client_secret Client secret tGwXSHpsPwj8UNbS +
redirect_uri Link to redirect person after authorization on the client’s site http://example.com/callback + | -

Response

{
    "token_type": "bearer",
    "expires_in": "2592000",
    "access_token": "<your_person_access_token>",
    "refresh_token": "<your_person_refresh_token>"
}

The response will return a JSON structure similar to adding a new person with refreshed pair of person tokens

Models

Main models of {title}

Person

{
    "id": "4d1252bb-4e67-4f91-9bea-a908575d62be",
    "secret": "Ypiey13mn3IKfkLk",
    "ts": "2022-05-16T15:17:35.656645Z",
    "communications": [],
    "identifiers": [],
    "names": []
}

Participant in the digital economy of intellectual property

Field Type Desc Example
ID string ID 4d1252bb-4e67-4f91-9bea-a908575d62be
Secret string Secret Ypiey13mn3IKfkLk
TS string TS of creation 2000-01-01T01:01:01.000001Z
Communications []struct List of communications here
Identifiers []struct List of identifiers here
Names []struct List of names here

Communication

{
    "id": "4d1252bb-4e67-4f91-9bea-a908575d62be",
    "communication": "mail@example.com",
    "communication_type": "email",
    "verified": 0,
    "attributes": {}
}

Way to communicate a person

Field Type Desc Example
ID string ID 4d1252bb-4e67-4f91-9bea-a908575d62be
Communication string Communication mail@example.com | 01234567890 | ...
Type string Type email | phone | ...
Verified int Verification status: 0 - in progress, 1 - approved, 2 - canceled 0 | 1 | 2
Attributes json Additional data {}

Identifier

{
    "id": "4d1252bb-4e67-4f91-9bea-a908575d62be",
    "identifier": "mail@example.com",
    "identifier_type": "email",
    "date_from": "2000-01-01",
    "date_to": "2020-01-01",
    "verified": 0,
    "attributes": {},
    "files": []
}

Way to identify a person

Field Type Desc Example
ID string ID 4d1252bb-4e67-4f91-9bea-a908575d62be
Identifier string Identifier mail@example.com | 01234567890 | ...
Type string Type email | phone | ...
Date from string Start date of use 2000-01-01
Date to string End date of use 2020-01-01
Verified int Verification status: 0 - in progress, 1 - approved, 2 - canceled 0 | 1 | 2
Attributes json Additional data {}
Files []struct List of files here

Identifier file

{
    "id": "4d1252bb-4e67-4f91-9bea-a908575d62be",
    "data": "RGF0YQ==",
    "hash": "f6068daa29dbb05a7ead1e3b5a48bbee",
    "comment": "Comment",
    "file_name": "filename.jpg",
    "date_from": "2000-01-01",
    "date_to": "2020-01-01",
    "verified": 0
}

Document data

Field Type Desc Example
ID string ID 4d1252bb-4e67-4f91-9bea-a908575d62be
Data string Base64 data RGF0YQ==
Hash string Server-side generated md5 hash from decompressing data from base64 format f6068daa29dbb05a7ead1e3b5a48bbee
Comment string Comment Important information
File name string Name of file file.jpg
Date from string Start date of use 2000-01-01
Date to string End date of use 2020-01-01
Verified int Verification status: 0 - in progress, 1 - approved, 2 - canceled 0 | 1 | 2 s

Name

{
    "id": "4d1252bb-4e67-4f91-9bea-a908575d62be",
    "first_name": "John",
    "last_name": "Kennedy",
    "middle_name": "Fitzgerald",
    "name_type": "name",
    "date_from": "2000-01-01",
    "date_to": "2020-01-01",
    "languages": ["eng"],
    "verified": 0,
    "attributes": {
        "suffixes": ["san"],
        "prefixes": ["Mr", "Dr"]
    }
}

Way to name a person

Field Type Desc Example
ID string ID 4d1252bb-4e67-4f91-9bea-a908575d62be
First name string First name / Name John
Last name string Last name Kennedy
Middle name string Middle name Fitzgerald
Type string Type name | synonym | alias | ...
Date from string Start date of use 2000-01-01
Date to string End date of use 2020-01-01
Languages []string List of languages ["eng"]
Verified int Verification status: 0 - in progress, 1 - approved, 2 - canceled 0 | 1 | 2
Attributes json Additional data {"suffixes": ["san"], "prefixes": ["Mr", "Dr"]}

Errors

In case of a request execution error with 4xx status, an error will be returned

Person with potential identifier regex error

{
  "secret": "password",
  "communications": [
    {
      "communication": "not-phone", // Potential regex error
      "communication_type": "phone",
      "verified": 0
    },
    {
      "communication": "not-phone", // Potential regex error
      "communication_type": "phone",
      "verified": 0
    }
  ],
  "identifiers": [
    {
      "identifier": "not-phone", // Potential regex error
      "identifier_type": "phone",
      "date_from": "2000-01-01",
      "date_to": "2020-01-01",
      "verified": 0
    }
  ]
}

Returned error

{
    "title": "person validation failed", // Error aggregating person error
    "inner_errors": [
        {
            "title": "communications validation failed", // Error aggregating communication errors
            "inner_errors": [
                {
                    "incoming_index": "0",
                    "messages": [
                        "communication must contain only numbers"
                    ]
                },
                {
                    "incoming_index": "1",
                    "messages": [
                        "communication must contain only numbers"
                    ]
                }
            ]
        },
        {
            "title": "identifiers validation failed", // Error aggregating identifier errors
            "inner_errors": [
                {
                    "incoming_index": "0",
                    "messages": [
                        "identifier must contain only numbers"
                    ]
                }
            ]
        }
    ]
}
Field Type Desc Example
Title string Error code person validation failed
Messages []string Error messages communication must contain only numbers
Incoming index int Error index array element 0
Internal errors []struct List of internal errors []