Identity

Access identity information such as firstname, lastname, birth date, gender, document country, document state and expiration date.

if you have chosen state mode while you were creating your app you can only access the identity state and document type of the user. No identity data is available.

get
Get all identity documents of a user

https://connect.synaps.io/v1/resources/identity
Return an array of identity document
Request
Response
Headers
Authorization
required
string
User access token Example : Bearer {access_token}
Content-Type
optional
string
application/json
200: OK
Identity documents of an authorized user
{
"data": [
{
"firstname": "",
"lastname": "",
"birth_date": "",
"nationality": "",
"document_number": "",
"document_type": "ID_CARD",
"expiration_date": "",
"state": "NOT_SUBMITTED",
"gender": ""
},
{
"firstname": "John",
"lastname": "Doe",
"birth_date": "1990-10-02",
"nationality": "French",
"document_number": "3928423423832",
"document_type": "PASSPORT",
"expiration_date": "NO_EXPIRATION",
"state": "VERIFIED",
"gender": "M"
}
],
"status": {
"error": false,
"api_code": "SUCCESS",
"type": "success",
"message": "success"
}
}
400: Bad Request
Invalid authorization code
{
"data": null,
"status": {
"error": true,
"api_code": "INVALID_AUTHORIZATION_CODE",
"type": "error",
"message": "Invalid authorization code"
}
}
401: Unauthorized
Unauthorized scope
{
"data": null,
"status": {
"error": true,
"api_code": "UNAUTHORIZED_SCOPE",
"type": "error",
"message": "Unauthorized scope"
}
}

API Response

Field

Type

Description

firstname

string

User firstname

lastname

string

User lastname

birth_date

string

User date of birth(Format: YYYY-MM-DD)

country

string

Document issuing country (see full country list available in reference)

nationality

string

User nationality (see full list of nationalities in reference)

gender

string

User gender

M - Male

F - Female

document_number

string

Document number

document_type

string

Identity document type

NATIONAL_ID - National ID Card PASSPORT - International Passport DRIVER_LICENSE - Driver License

RESIDENT_PERMIT - Resident Permit

expiration_date

string

Document expiration date (Format: YYYY-MM-DD)

NO_EXPIRATION - Document doesn't have expiration date

state

string

Document verification state

PENDING - pending confirmation

NOT_SUBMITTED - not yet submitted

VERIFIED - verified

EXPIRED - expired

REJECTED- rejected

liveness

string

Liveness verification state

FAILED - Failed liveness verification

PASSED - Successful liveness verification

similarity_score

float

Matching percentage between liveness challenge and identity document

trust_score

int

Verification confidence between 0 and 100

check_gender

int

Check if user gender is correct

1- Correct

-1- Incorrect

check_document_expiration

int

Check if document is not expired

1- Not expired

-1- Expired

check_date_of_birth

int

Check if user birth date is correct

1- Correct

-1- Incorrect

check_mrz

int

Check if MRZ is verified

1- Verified

-1- Not verified

check_document_number

int

Check if document number is verified

1- Verified

-1- Not verified

check_image_quality

int

Check if image quality is good quality

1- Good quality

-1- Bad quality

check_color_picture

int

Check if image is colored

1- Colored image

-1- Black and white image

check_face_matching

int

Check if document face is matching liveness verification

1- Match

-1- Don't match

check_security_features

int

Check document security features

1- Verified

-1- Not verified

check_country

int

Check if document country is correct

1- Correct

-1- Incorrect

aml_compliance

string

AML state given by Synaps

PENDING - pending verification

COMPLIANT- User passed AML compliance

NOT_COMPLIANT - User did not pass AML compliance

UNCERTAIN - Synaps doesn't have enough information to proceed the user and let the compliance officer taking the decision

app_aml_compliance

string

If the aml_compliance is set to UNCERTAIN this value is refering to the app compliance officer decision

PENDING - pending verification

COMPLIANT- User passed AML compliance

NOT_COMPLIANT - User did not pass AML compliance

aml_check

aml_response object

AML verification details. See AML section

AML Checks are only available for AML subscription.

Code Snippets

cURL
Java
Javascript
Node.js
Python
PHP
Ruby
Go
C#
curl --include \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer access_token" \
'https://connect.synaps.io/v1/resources/identity'
// Maven : Add these dependecies to your pom.xml (java6+)
// <dependency>
// <groupId>org.glassfish.jersey.core</groupId>
// <artifactId>jersey-client</artifactId>
// <version>2.8</version>
// </dependency>
// <dependency>
// <groupId>org.glassfish.jersey.media</groupId>
// <artifactId>jersey-media-json-jackson</artifactId>
// <version>2.8</version>
// </dependency>
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
Client client = ClientBuilder.newClient();
Response response = client.target("https://connect.synaps.io/v1/resources/identity")
.request(MediaType.APPLICATION_JSON_TYPE)
.header("Accept", "application/json")
.header("Authorization", "Bearer access_token")
.get();
System.out.println("status: " + response.getStatus());
System.out.println("headers: " + response.getHeaders());
System.out.println("body:" + response.readEntity(String.class));
var request = new XMLHttpRequest();
request.open('GET', 'https://connect.synaps.io/v1/resources/identity');
request.setRequestHeader('Content-Type', 'application/json');
request.setRequestHeader('Accept', 'application/json');
request.setRequestHeader('Authorization', 'Bearer access_token');
request.onreadystatechange = function () {
if (this.readyState === 4) {
console.log('Status:', this.status);
console.log('Headers:', this.getAllResponseHeaders());
console.log('Body:', this.responseText);
}
};
request.send();
var request = require('request');
request({
method: 'GET',
url: 'https://connect.synaps.io/v1/resources/identity',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer access_token'
}}, function (error, response, body) {
console.log('Status:', response.statusCode);
console.log('Headers:', JSON.stringify(response.headers));
console.log('Response:', body);
});
from urllib2 import Request, urlopen
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer access_token'
}
request = Request('https://connect.synaps.io/v1/resources/identity', headers=headers)
response_body = urlopen(request).read()
print response_body
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://connect.synaps.io/v1/resources/identity");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Accept: application/json",
"Authorization: Bearer access_token"
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
require 'rubygems' if RUBY_VERSION < '1.9'
require 'rest_client'
headers = {
:content_type => 'application/json',
:accept => 'application/json',
:authorization => 'Bearer access_token'
}
response = RestClient.get 'https://connect.synaps.io/v1/resources/identity', headers
puts response
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://connect.synaps.io/v1/resources/identity", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Bearer access_token")
resp, err := client.Do(req)
if err != nil {
fmt.Println("Errored when sending request to the server")
return
}
defer resp.Body.Close()
resp_body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(resp.Status)
fmt.Println(string(resp_body))
}
//Common testing requirement. If you are consuming an API in a sandbox/test region, uncomment this line of code ONLY for non production uses.
//System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
//Be sure to run "Install-Package Microsoft.Net.Http" from your nuget command line.
using System;
using System.Net.Http;
var baseAddress = new Uri("https://connect.synaps.io/");
using (var httpClient = new HttpClient{ BaseAddress = baseAddress })
{
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "application/json");
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("authorization", "Bearer access_token");
using(var response = await httpClient.GetAsync("v1/resources/identity"))
{
string responseData = await response.Content.ReadAsStringAsync();
}
}

get
Get specific identity document of a user

https://connect.synaps.io/v1/resources/identity
Return specific identity document
Request
Response
Headers
Authorization
required
string
User access token Example : Bearer {access_token}
Content-Type
optional
string
application/json
Query Parameters
document
required
string
Identity document type national_id - National ID Card passport - International Passport driver_license - Driver License resident_permit - Resident Permit
200: OK
Identity document of a user
{
"data": {
"firstname": "John",
"lastname": "Doe",
"birth_date": "1990-10-02",
"nationality": "French",
"document_number": "3928423423832",
"document_type": "ID_CARD",
"expiration_date": "NO_EXPIRATION",
"state": "VERIFIED",
"gender": "M"
},
"status": {
"error": false,
"api_code": "SUCCESS",
"type": "success",
"message": "success"
}
}
400: Bad Request
Invalid authorization code
{
"data": null,
"status": {
"error": true,
"api_code": "INVALID_AUTHORIZATION_CODE",
"type": "error",
"message": "Invalid authorization code"
}
}
401: Unauthorized
Unauthorized scope
{
"data": null,
"status": {
"error": true,
"api_code": "UNAUTHORIZED_SCOPE",
"type": "error",
"message": "Unauthorized scope"
}
}

API Response

Return the same identity document object described as above

Code Snippets

cURL
Java
Javascript
Node.js
Python
PHP
Ruby
Go
C#
curl --include \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer access_token" \
'https://connect.synaps.io/v1/resources/identity?document={document}'
// Maven : Add these dependecies to your pom.xml (java6+)
// <dependency>
// <groupId>org.glassfish.jersey.core</groupId>
// <artifactId>jersey-client</artifactId>
// <version>2.8</version>
// </dependency>
// <dependency>
// <groupId>org.glassfish.jersey.media</groupId>
// <artifactId>jersey-media-json-jackson</artifactId>
// <version>2.8</version>
// </dependency>
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
Client client = ClientBuilder.newClient();
Response response = client.target("https://connect.synaps.io/v1/resources/identity?document={document}")
.request(MediaType.APPLICATION_JSON_TYPE)
.header("Accept", "application/json")
.header("Authorization", "Bearer access_token")
.get();
System.out.println("status: " + response.getStatus());
System.out.println("headers: " + response.getHeaders());
System.out.println("body:" + response.readEntity(String.class));
var request = new XMLHttpRequest();
request.open('GET', 'https://connect.synaps.io/v1/resources/identity?document={document}');
request.setRequestHeader('Content-Type', 'application/json');
request.setRequestHeader('Accept', 'application/json');
request.setRequestHeader('Authorization', 'Bearer access_token');
request.onreadystatechange = function () {
if (this.readyState === 4) {
console.log('Status:', this.status);
console.log('Headers:', this.getAllResponseHeaders());
console.log('Body:', this.responseText);
}
};
request.send();
var request = require('request');
request({
method: 'GET',
url: 'https://connect.synaps.io/v1/resources/identity?document={document}',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer access_token'
}}, function (error, response, body) {
console.log('Status:', response.statusCode);
console.log('Headers:', JSON.stringify(response.headers));
console.log('Response:', body);
});
from urllib2 import Request, urlopen
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer access_token'
}
request = Request('https://connect.synaps.io/v1/resources/identity?document={document}', headers=headers)
response_body = urlopen(request).read()
print response_body
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://connect.synaps.io/v1/resources/identity?document={document}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Accept: application/json",
"Authorization: Bearer access_token"
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
require 'rubygems' if RUBY_VERSION < '1.9'
require 'rest_client'
headers = {
:content_type => 'application/json',
:accept => 'application/json',
:authorization => 'Bearer access_token'
}
response = RestClient.get 'https://connect.synaps.io/v1/resources/identity?document={document}', headers
puts response
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://connect.synaps.io/v1/resources/identity?document={document}", nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Bearer access_token")
resp, err := client.Do(req)
if err != nil {
fmt.Println("Errored when sending request to the server")
return
}
defer resp.Body.Close()
resp_body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(resp.Status)
fmt.Println(string(resp_body))
}
//Common testing requirement. If you are consuming an API in a sandbox/test region, uncomment this line of code ONLY for non production uses.
//System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
//Be sure to run "Install-Package Microsoft.Net.Http" from your nuget command line.
using System;
using System.Net.Http;
var baseAddress = new Uri("https://connect.synaps.io/");
using (var httpClient = new HttpClient{ BaseAddress = baseAddress })
{
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "application/json");
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("authorization", "Bearer access_token");
using(var response = await httpClient.GetAsync("v1/resources/identity?document={document}"))
{
string responseData = await response.Content.ReadAsStringAsync();
}
}