Account Deduplication (1:N)
This service is designed to initiate a transaction request for a facial search algorithm. This algorithm is specifically tailored to detect whether a new image or account already exists in the database. The primary purpose of this service is to identify whether the account exists or not.
Create Face Search Transaction
This endpoint will initiate a transaction request and returns reference_id if the request includes proper authentication, and valid fields mentioned below in request parameter.
Endpoint
POSThttps://app.facia.ai/backend/api/transaction/create-transaction/face-deduplication
Authorization:
Token Type: BearerDescription:
This API utilizes Access token or Client-Secret key in header for authentication.
You may use your client_id and client_secret key while using "/get-access-token" endpoint in order to get a Bearer token for authorization, while connecting to this API. For further details about Authorization click Here
Request Body Samples:
- Payload
- PHP
- Python
- Javascript
// Method : POST
{
"type": "string",
"file": file
}
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '/api/transaction/create-transaction/face-deduplication',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(,'file'=> new CURLFILE('/321238932_678447270428202_3141578377253799698_n.jpeg')),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer token'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "/api/transaction/create-transaction/face-deduplication"
payload={}
files=[
('file',('321238932_678447270428202_3141578377253799698_n.jpeg',open('/321238932_678447270428202_3141578377253799698_n.jpeg','rb'),'image/jpeg'))
]
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer token");
var formdata = new FormData();
formdata.append("type", "face_search");
formdata.append("file", fileInput.files[0], "321238932_678447270428202_3141578377253799698_n.jpeg");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: formdata,
redirect: 'follow'
};
fetch("/api/transaction/create-transaction/face-deduplication", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Request Parameter
| Parameters | Description |
|---|---|
| type | Required: Yes Type: string Type must be face_search Example: type=face_search |
| file | Required: Yes Type: file File must be of type .jpg or .png Example: file=file |
Response Sample
{
"status": true,
"message": "Success",
"result": {
"data": {
"reference_id": "W4437KIWN0KDM13"
}
}
}
Response Parameter
| Parameters | Description |
|---|---|
| reference_id | Type: string Example: reference_id=W4437KIWN0KDM13 |
| message | Type: string Example: message=Success |
Face Search Result
This endpoint accepts a single field in the body request payload; reference_id (String). Once the response has been finalised at the backend, this endpoint returns a face_search_response object with a multiple object ids of images with most similar features with the provided image. Failure to provide a valid reference_id will result in a 422 status code.
Endpoint
POSThttps://app.facia.ai/backend/api/transaction/face-duplication-result
Authorization:
Token Type: BearerDescription:
This API utilizes Access token or Client-Secret key in header for authentication.
You may use your client_id and client_secret key while using "/get-access-token" endpoint in order to get a Bearer token for authorization, while connecting to this API. For further details about Authorization click Here
Request Body Samples:
- Payload
- PHP
- Python
- Javascript
// Method : POST
{
"reference_id": "string"
}
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '/api/transaction/face-duplication-result',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer token'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "/api/transaction/face-duplication-result"
payload={}
files=[
]
headers = {
'Authorization': 'Bearer token'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer token");
var formdata = new FormData();
formdata.append("reference_id", "W4437KIWN0KDM13");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: formdata,
redirect: 'follow'
};
fetch("/api/transaction/face-duplication-result", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Request Parameter
| Parameters | Description |
|---|---|
reference_id required | Type: string Example: reference_id=W4437KIWN0KDM13 |
Response Sample
{
"status": true,
"message": "Success",
"result": {
"data": {
"deleted_at": "64918c825b6bdfaa65024ffc",
"updated_at": "64918c825b6bdfaa65024ffc",
"account_exist": "true",
"face_found": "true"
}
}
}
Response Parameter
| Parameters | Description |
|---|---|
| deleted_at | Type: string Example: deleted_at=2023-06-21T11:26:53.496000Z |
| updated_at | Type: string Example: updated_at=64918c825b6bdfaa65024ffc |
| account_exist | Type: string Example: account_exist=true |
| face_found | Type: string Example: face_found=true |