Verify By Face
curl --request POST \
--url https://api.authentica.sa/api/v2/verify-by-face \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"user_id": "user123",
"registered_face_image": "/9j/4AAQSkZJRgABAQEAYABgAAD...",
"query_face_image": "/9j/4AAQSkZJRgABAQEAYABgAAD..."
}
'import requests
url = "https://api.authentica.sa/api/v2/verify-by-face"
payload = {
"user_id": "user123",
"registered_face_image": "/9j/4AAQSkZJRgABAQEAYABgAAD...",
"query_face_image": "/9j/4AAQSkZJRgABAQEAYABgAAD..."
}
headers = {
"X-Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Authorization': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: 'user123',
registered_face_image: '/9j/4AAQSkZJRgABAQEAYABgAAD...',
query_face_image: '/9j/4AAQSkZJRgABAQEAYABgAAD...'
})
};
fetch('https://api.authentica.sa/api/v2/verify-by-face', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.authentica.sa/api/v2/verify-by-face",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => 'user123',
'registered_face_image' => '/9j/4AAQSkZJRgABAQEAYABgAAD...',
'query_face_image' => '/9j/4AAQSkZJRgABAQEAYABgAAD...'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.authentica.sa/api/v2/verify-by-face"
payload := strings.NewReader("{\n \"user_id\": \"user123\",\n \"registered_face_image\": \"/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"query_face_image\": \"/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.authentica.sa/api/v2/verify-by-face")
.header("X-Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"user123\",\n \"registered_face_image\": \"/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"query_face_image\": \"/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.authentica.sa/api/v2/verify-by-face")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"user123\",\n \"registered_face_image\": \"/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"query_face_image\": \"/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"user_id": "user123",
"result": true
}
}Face Verification
Verify By Face
Verify whether the reference image and the real-time image match.
This endpoint compares two face images:
registered_face_image: Reference imagequery_face_image: Real-time image captured by your application
POST
/
verify-by-face
Verify By Face
curl --request POST \
--url https://api.authentica.sa/api/v2/verify-by-face \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"user_id": "user123",
"registered_face_image": "/9j/4AAQSkZJRgABAQEAYABgAAD...",
"query_face_image": "/9j/4AAQSkZJRgABAQEAYABgAAD..."
}
'import requests
url = "https://api.authentica.sa/api/v2/verify-by-face"
payload = {
"user_id": "user123",
"registered_face_image": "/9j/4AAQSkZJRgABAQEAYABgAAD...",
"query_face_image": "/9j/4AAQSkZJRgABAQEAYABgAAD..."
}
headers = {
"X-Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Authorization': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: 'user123',
registered_face_image: '/9j/4AAQSkZJRgABAQEAYABgAAD...',
query_face_image: '/9j/4AAQSkZJRgABAQEAYABgAAD...'
})
};
fetch('https://api.authentica.sa/api/v2/verify-by-face', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.authentica.sa/api/v2/verify-by-face",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => 'user123',
'registered_face_image' => '/9j/4AAQSkZJRgABAQEAYABgAAD...',
'query_face_image' => '/9j/4AAQSkZJRgABAQEAYABgAAD...'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.authentica.sa/api/v2/verify-by-face"
payload := strings.NewReader("{\n \"user_id\": \"user123\",\n \"registered_face_image\": \"/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"query_face_image\": \"/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.authentica.sa/api/v2/verify-by-face")
.header("X-Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"user123\",\n \"registered_face_image\": \"/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"query_face_image\": \"/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.authentica.sa/api/v2/verify-by-face")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"user123\",\n \"registered_face_image\": \"/9j/4AAQSkZJRgABAQEAYABgAAD...\",\n \"query_face_image\": \"/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"user_id": "user123",
"result": true
}
}Authorizations
API key for authentication. Get Your API Key
Body
application/json
Unique identifier of your user
Example:
"user123"
Base64-encoded reference image
Example:
"/9j/4AAQSkZJRgABAQEAYABgAAD..."
Base64-encoded real-time image captured by your application
Example:
"/9j/4AAQSkZJRgABAQEAYABgAAD..."
⌘I