Identify Service: Anti-Spoof API
This api service allows you to compare 2 images (usually a selfie image and an image from an ID) and check if they are the same person. Below is a sample of your request body when you post to the api endpoint.
Request Body: JSON
{
"service": "identify-anti-spoof",
"payload": {
"image_link": "<LINK TO SELFIE IMAGE>",
"webhook_name": "<YOUR WEBHOOK NAME IDENTIFIER>",
"source_id": "<UNIQUE ID FOR REQUEST>"
}
}
Request Body Definition
- service - This defines the service that we want to use
- payload - Information needed in order for the service to process the request
- payload.image_link - The link of the selfie image to be checked for spoofing.
- payload.webhook_name - This is the name of the webhook endpoint where you would like to receive the results. The name is what you have assigned when you added the webhook.
- payload.source_id - This is a unique identifier that you generate for the request so that when you receive it in the webhook, you can identify which request the webhook data belongs to.
Sample Response
{
"message": "identify-anti-spoof request received",
"remaining_credits": 92
}
If your request is not successful, you will receive a message from the json response describing the error. Possible errors may be due to:
- Invalid API token with status code 401
- Invalid service name with status code of 422
- Not enough credits with status code of 422
- Invalid payload with status code of 422
Webhook Data Received: JSON
{
"source_event": "identify-anti-spoof",
"payload": {
"passed": true,
"probability": .91,
"image_link": "<LINK TO SELFIE IMAGE>",
"source_id": "<YOUR UNIQUE REQUEST ID>"
},
"error": null,
"completed_at": "2024-01-13T05:39:48.966984+00:00"
}
Webhook Data Definition
- source_event - The name of the service
- error - The error message if there was an error processing the request or null if processing was successful.
- completed_at - The time the process was completed and sent to your webhook endpoint. It follows the ISO 8601 format.
- payload.image_source_link - The link of the image source that you sent with the initial request.
- payload.image_link - The link of the image that you sent with the initial request.
- payload.source_id - This is a unique identifier that you sent with the initial request.
- payload.passed - The result of whether the image passed the test as not being spoofed.
- payload.probability - The probability that the result is correct. A value of near 1.0 means that it is likely that the results are correct.