REST API

Rest API for Backend or custom integrations

Use this documentation to verify your users, detect liveness, and integrate into your UI/UX via a REST API. Although we recommend using the SDKs, we know that some systems may be better suited for the REST API, so we got you covered.

How to use the Rest API

1) Onboarding new customers

Andia stores the Biometrics Vectors from a video selfie (dynamic validation) or a picture selfie (static validation) that is taken during on-boarding process. This method returns a unique user identifier (user_id), with which one-to-one validations will be carried out later.

2) Dynamic Validations (Liveness Detection)

Verify a user is alive by validating that the user has blinked on video against the existing user_id.

3) Static Validations (no Liveness Detection)

Verify if a Selfie taken corresponds to an existing user_id (a user who has previously been onboarded).

Dynamic Validations (Liveness validation) endpoints

post
Register new customer

https://api.andia.io/v1/register_new_customer_video
This endpoint generates the Biometric vectors from new users using a short selfie video (1 to 3 seconds long) and returns a unique user_id.
Request
Response
Request
Headers
Content-Type
required
string
application/json
Authentication
required
string
Your API_KEY
Form Data Parameters
video64
optional
string
Base64 string (converted from mp4 format to Base64) ***The video must include a user blink.
video
optional
object
Selfie video file (mp4 format) Recommended size less than 2 Mb Important ***The video must include a user blink.
Response
200: OK
{
"success": true,
"error_code": 0,
"error": "",
"message": "success",
"user_id": "fb61986b-8208-4b9b-b4d5-49eb1178cdcd"
}
Node.js
PHP
Java
ASP.NET (C#)
Ruby
Python
Node.js
var request = require('request');
request({
method: 'POST',
url: 'https://api.andia.io/v1/register_new_customer_video',
headers: {
'Content-Type': 'multipart/form-data;boundary={boundary value}',
'Authentication': 'Your API_KEY'
},
body: "--{boundary value}
Content-Disposition: form-data; name="video";
video
--{boundary value}--"
}, function (error, response, body) {
console.log('Status:', response.statusCode);
console.log('Headers:', JSON.stringify(response.headers));
console.log('Response:', body);
});
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.andia.io/v1/register_new_customer_video");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, --{boundary value}
Content-Disposition: form-data; name="video";
video
--{boundary value}--);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: multipart/form-data;boundary={boundary value}",
"Authentication: Your API_KEY"
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
Java
// 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();
Entity<String> payload = Entity.text("--{boundary value}
Content-Disposition: form-data; name="video";
video
--{boundary value}--");
Response response = client.target("https://api.andia.io/v1/register_new_customer_video")
.request(MediaType.TEXT_PLAIN_TYPE)
.header("Authentication", "Your API_KEY")
.post(payload);
System.out.println("status: " + response.getStatus());
System.out.println("headers: " + response.getHeaders());
System.out.println("body:" + response.readEntity(String.class));
ASP.NET (C#)
//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://api.andia.io/v1/");
using (var httpClient = new HttpClient{ BaseAddress = baseAddress })
{
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("authentication", "Your API_KEY");
using (var content = new StringContent("--{boundary value}
Content-Disposition: form-data; name="video";
video
--{boundary value}--", System.Text.Encoding.Default, "multipart/form-data;boundary={boundary value}"))
{
using (var response = await httpClient.PostAsync("register_new_customer_video", content))
{
string responseData = await response.Content.ReadAsStringAsync();
}
}
}
Ruby
require 'rubygems' if RUBY_VERSION < '1.9'
require 'rest_client'
values = --{boundary value}
Content-Disposition: form-data; name="video";
video
--{boundary value}--
headers = {
:content_type => 'multipart/form-data;boundary={boundary value}',
:authentication => 'Your API_KEY'
}
response = RestClient.post 'https://api.andia.io/v1/register_new_customer_video', values, headers
puts response
Python
from urllib2 import Request, urlopen
values = """
--{boundary value}
Content-Disposition: form-data; name="video";
video
--{boundary value}--"""
headers = {
'Content-Type': 'multipart/form-data;boundary={boundary value}',
'Authentication': 'Your API_KEY'
}
request = Request('https://api.andia.io/v1/register_new_customer_video', data=values, headers=headers)
response_body = urlopen(request).read()
print response_body

post
Validation

https://api.andia.io/v1/validate_transaction_video
This endpoint compare an existing user_id against a short selfie video (1 to 3 seconds long).
Request
Response
Request
Headers
Content-Type
required
string
application/json
Authentication
required
string
Your API_KEY
Form Data Parameters
video64
optional
string
Base64 string (converted from mp4 format to Base64) ***The video must include a user blink
user_id
required
string
An existing user identifier
video
optional
object
Selfie video file (mp4 format) Recommended size less than 2 Mb. Important ***The video must include a user blink.
Response
200: OK
{
"success": true,
"error_code": 0,
"error": "",
"message": "It is a Match"
}
Node.js
PHP
Java
ASP.NET (C#)
Ruby
Python
Node.js
var request = require('request');
request({
method: 'POST',
url: 'https://api.andia.io/v1/validate_transaction_video',
headers: {
'Content-Type': 'multipart/form-data;boundary={boundary value}',
'Authentication': 'Your API_KEY',
'Content-Disposition': 'form-data;''
},
body: "--{boundary value}
Content-Disposition: form-data; name="user_id";
user_id
--{boundary value}
Content-Disposition: form-data; name="video";
video
--{boundary value}--"
}, function (error, response, body) {
console.log('Status:', response.statusCode);
console.log('Headers:', JSON.stringify(response.headers));
console.log('Response:', body);
});
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.andia.io/v1/validate_transaction_video");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, --{boundary value}
Content-Disposition: form-data; name="user_id";
user_id
--{boundary value}
Content-Disposition: form-data; name="video";
video
--{boundary value}--);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: multipart/form-data;boundary={boundary value}",
"Authentication: Your API_KEY",
"Content-Disposition: form-data;""
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
Java
// 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();
Entity<String> payload = Entity.text("--{boundary value}
Content-Disposition: form-data; name="user_id";
user_id
--{boundary value}
Content-Disposition: form-data; name="video";
video
--{boundary value}--");
Response response = client.target("https://api.andia.io/v1/validate_transaction_video")
.request(MediaType.TEXT_PLAIN_TYPE)
.header("Authentication", "Your API_KEY")
.header("Content-Disposition", "form-data;"")
.post(payload);
System.out.println("status: " + response.getStatus());
System.out.println("headers: " + response.getHeaders());
System.out.println("body:" + response.readEntity(String.class));
ASP.NET (C#)
//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://api.andia.io/v1/");
using (var httpClient = new HttpClient{ BaseAddress = baseAddress })
{
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("authentication", "Your API_KEY");
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("content-disposition", "form-data;"");
using (var content = new StringContent("--{boundary value}
Content-Disposition: form-data; name="user_id";
user_id
--{boundary value}
Content-Disposition: form-data; name="video";
video
--{boundary value}--", System.Text.Encoding.Default, "multipart/form-data;boundary={boundary value}"))
{
using (var response = await httpClient.PostAsync("validate_transaction_video", content))
{
string responseData = await response.Content.ReadAsStringAsync();
}
}
}
Ruby
require 'rubygems' if RUBY_VERSION < '1.9'
require 'rest_client'
values = --{boundary value}
Content-Disposition: form-data; name="user_id";
user_id
--{boundary value}
Content-Disposition: form-data; name="video";
video
--{boundary value}--
headers = {
:content_type => 'multipart/form-data;boundary={boundary value}',
:authentication => 'Your API_KEY',
:content_disposition => 'form-data;"'
}
response = RestClient.post 'https://api.andia.io/v1/validate_transaction_video', values, headers
puts response
Python
from urllib2 import Request, urlopen
values = """
--{boundary value}
Content-Disposition: form-data; name="user_id";
user_id
--{boundary value}
Content-Disposition: form-data; name="video";
video
--{boundary value}--"""
headers = {
'Content-Type': 'multipart/form-data;boundary={boundary value}',
'Authentication': 'Your API_KEY',
'Content-Disposition': 'form-data;''
}
request = Request('https://api.andia.io/v1/validate_transaction_video', data=values, headers=headers)
response_body = urlopen(request).read()
print response_body

Static methods (No Liveness detection) in case of existing user images

post
Register new customer

https://api.andia.io/v1/register_new_customer
This endpoint stores the Biometric vectors from new users and generate a unique user_id.
Request
Response
Request
Headers
Content-Type
required
string
application/json
Authentication
required
string
Your API_KEY
Form Data Parameters
selfie
optional
object
Selfie image file (jpg format) Recommended size less than 512 Kb
Body Parameters
selfie64
optional
string
Base 64 jpg Image (Required if selfie file is not provided) Recommended size less than 512 Kb
Response
200: OK
{
"success": true,
"error_code": 0,
"error": "",
"message": "success",
"user_id": "fb61986b-8208-4b9b-b4d5-49eb1178cdcd"
}
Node.js
PHP
Java
ASP.NET (C#)
Ruby
Python
Node.js
var request = require('request');
request({
method: 'POST',
url: 'https://api.andia.io/v1/register_new_customer',
headers: {
'Content-Type': 'multipart/form-data;boundary={boundary value}',
'Authentication': 'Your API_KEY',
'Content-Disposition': 'form-data;''
},
body: "--{boundary value}
Content-Disposition: form-data; name="selfie";
selfie
--{boundary value}--"
}, function (error, response, body) {
console.log('Status:', response.statusCode);
console.log('Headers:', JSON.stringify(response.headers));
console.log('Response:', body);
});
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.andia.io/v1/register_new_customer");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, --{boundary value}
Content-Disposition: form-data; name="selfie";
selfie
--{boundary value}--);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: multipart/form-data;boundary={boundary value}",
"Authentication: Your API_KEY",
"Content-Disposition: form-data;""
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
Java
// 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();
Entity<String> payload = Entity.text("--{boundary value}
Content-Disposition: form-data; name="selfie";
selfie
--{boundary value}--");
Response response = client.target("https://api.andia.io/v1/register_new_customer")
.request(MediaType.TEXT_PLAIN_TYPE)
.header("Authentication", "Your API_KEY")
.header("Content-Disposition", "form-data;"")
.post(payload);
System.out.println("status: " + response.getStatus());
System.out.println("headers: " + response.getHeaders());
System.out.println("body:" + response.readEntity(String.class));
ASP.NET (C#)
//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://api.andia.io/v1/");
using (var httpClient = new HttpClient{ BaseAddress = baseAddress })
{
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("authentication", "Your API_KEY");
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("content-disposition", "form-data;"");
using (var content = new StringContent("--{boundary value}
Content-Disposition: form-data; name="selfie";
selfie
--{boundary value}--", System.Text.Encoding.Default, "multipart/form-data;boundary={boundary value}"))
{
using (var response = await httpClient.PostAsync("register_new_customer", content))
{
string responseData = await response.Content.ReadAsStringAsync();
}
}
}
Ruby
require 'rubygems' if RUBY_VERSION < '1.9'
require 'rest_client'
values = --{boundary value}
Content-Disposition: form-data; name="selfie";
selfie
--{boundary value}--
headers = {
:content_type => 'multipart/form-data;boundary={boundary value}',
:authentication => 'Your API_KEY',
:content_disposition => 'form-data;"'
}
response = RestClient.post 'https://api.andia.io/v1/register_new_customer', values, headers
puts response
Python
from urllib2 import Request, urlopen
values = """
--{boundary value}
Content-Disposition: form-data; name="selfie";
selfie
--{boundary value}--"""
headers = {
'Content-Type': 'multipart/form-data;boundary={boundary value}',
'Authentication': 'Your API_KEY',
'Content-Disposition': 'form-data;''
}
request = Request('https://api.andia.io/v1/register_new_customer', data=values, headers=headers)
response_body = urlopen(request).read()
print response_body

post
Validation

https://api.andia.io/v1/validate_transaction
This endpoint compare an existing user_id against a Selfie.
Request
Response
Request
Headers
Content-Type
required
string
application/json
Authentication
required
string
Your API_KEY
Form Data Parameters
selfie64
optional
string
Base 64 JPG Image Required if selfie file is not provided Recommended size less than 512 Kb
user_id
required
string
An existing user identifier
selfie
optional
object
Selfie image file (jpg format) Recommended size less than 512 Kb
Response
200: OK
Cake successfully retrieved.
{
"success": true,
"error_code": 0,
"error": "",
"message": "It is a Match"
}
Node.js
PHP
Java
ASP.NET (C#)
Ruby
Python
Node.js
var request = require('request');
request({
method: 'POST',
url: 'https://api.andia.io/v1/validate_transaction',
headers: {
'Content-Type': 'multipart/form-data;boundary={boundary value}',
'Authentication': 'Your API_KEY',
'Content-Disposition': 'form-data;''
},
body: "--{boundary value}
Content-Disposition: form-data; name="user_id";
user_id
--{boundary value}
Content-Disposition: form-data; name="selfie";
video
--{boundary value}--"
}, function (error, response, body) {
console.log('Status:', response.statusCode);
console.log('Headers:', JSON.stringify(response.headers));
console.log('Response:', body);
});
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.andia.io/v1/validate_transaction");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, --{boundary value}
Content-Disposition: form-data; name="user_id";
user_id
--{boundary value}
Content-Disposition: form-data; name="selfie";
video
--{boundary value}--);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: multipart/form-data;boundary={boundary value}",
"Authentication: Your API_KEY",
"Content-Disposition: form-data;""
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
Java
// 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();
Entity<String> payload = Entity.text("--{boundary value}
Content-Disposition: form-data; name="user_id";
user_id
--{boundary value}
Content-Disposition: form-data; name="selfie";
video
--{boundary value}--");
Response response = client.target("https://api.andia.io/v1/validate_transaction")
.request(MediaType.TEXT_PLAIN_TYPE)
.header("Authentication", "Your API_KEY")
.header("Content-Disposition", "form-data;"")
.post(payload);
System.out.println("status: " + response.getStatus());
System.out.println("headers: " + response.getHeaders());
System.out.println("body:" + response.readEntity(String.class));
ASP.NET (C#)
//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://api.andia.io/v1/");
using (var httpClient = new HttpClient{ BaseAddress = baseAddress })
{
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("authentication", "Your API_KEY");
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("content-disposition", "form-data;"");
using (var content = new StringContent("--{boundary value}
Content-Disposition: form-data; name="user_id";
user_id
--{boundary value}
Content-Disposition: form-data; name="selfie";
video
--{boundary value}--", System.Text.Encoding.Default, "multipart/form-data;boundary={boundary value}"))
{
using (var response = await httpClient.PostAsync("validate_transaction", content))
{
string responseData = await response.Content.ReadAsStringAsync();
}
}
}
Ruby
require 'rubygems' if RUBY_VERSION < '1.9'
require 'rest_client'
values = --{boundary value}
Content-Disposition: form-data; name="user_id";
user_id
--{boundary value}
Content-Disposition: form-data; name="selfie";
video
--{boundary value}--
headers = {
:content_type => 'multipart/form-data;boundary={boundary value}',
:authentication => 'Your API_KEY',
:content_disposition => 'form-data;"'
}
response = RestClient.post 'https://api.andia.io/v1/validate_transaction', values, headers
puts response
Python
from urllib2 import Request, urlopen
values = """
--{boundary value}
Content-Disposition: form-data; name="user_id";
user_id
--{boundary value}
Content-Disposition: form-data; name="selfie";
video
--{boundary value}--"""
headers = {
'Content-Type': 'multipart/form-data;boundary={boundary value}',
'Authentication': 'Your API_KEY',
'Content-Disposition': 'form-data;''
}
request = Request('https://api.andia.io/v1/validate_transaction', data=values, headers=headers)
response_body = urlopen(request).read()
print response_body