Guidance for Using the Face Search API

Introduction
The Face Search API is a powerful tool for facial recognition that matches face images with ID numbers stored in a database. It’s a critical resource for identity verification and fraud prevention. This guide walks you through the steps to successfully integrate and use the API in your system.

Step-by-Step Guide to Integrate the Face Search API

1. Obtain API Access Token
Before you can make API requests, you need to authenticate by generating a token. Use your accessKey, secretKey, and a timestamp to create a token. Here’s an example:

curl -X POST \ -H "Content-Type: application/json" \ -d '{"accessKey":"22********70b","signature":"sample_signature","timestamp":1648785145789,"periodSecond":120}' \ "https://api.advance.ai/openapi/auth/ticket/v1/generate-token"

2. Prepare Your Face Search Request
Once you have your token, you can make the Face Search request. Below is an example using curl:

curl -X POST \ -H "X-ACCESS-TOKEN: {Your Access Token}" \ -H "Content-Type: multipart/form-data" \ -F "faceImage=@/path/to/faceImage.jpg" \ -F "idNumber=1234567890123456" \ -F "referId=unique_reference_id" \ -F "imageType=PHOTO_FACE" \ "https://api.advance.ai/openapi/face-recognition/v1/face-search"

3. Key Parameters for the API Request

  • X-ACCESS-TOKEN: Your unique API token.
  • faceImage: The image file (JPEG/PNG) for the face to search.
  • idNumber: A 16-digit ID number (NIK) that corresponds to the person in the image.
  • referId: A unique transaction reference in your system.
  • imageType: Set this to PHOTO_FACE for images like selfies or ID-holding pictures.

4. Handle the API Response
The response from the API includes a status code indicating success or failure. A successful response looks like this:

{ "code": "SUCCESS", "transactionId": "196eb0c777789e58", "pricingStrategy": "PAY", "message": "OK", "data": [ { "referId": "332090", "idNumber": "3271032503570001", "similarity": 89.0 } ] }

The similarity field indicates how closely the uploaded face matches those in the database, with a score between 0 and 100.

5. Best Practices for Image Quality
For optimal results, make sure the uploaded images:

  • Are in JPEG or PNG format.
  • Have a size between 128x128 and 4096x4096 pixels.
  • Are less than 2 MB in size.

Conclusion
By following this guide, you can seamlessly integrate the Face Search API into your application and perform efficient identity verification.

 

Further Assistance

If you continue to experience issues despite following the guidelines provided, please contact our support team for further assistance:

Was this article helpful?
1 out of 2 found this helpful

Comments

0 comments

Please sign in to leave a comment.