Face Match
Introduction
The Face Match API allows users to perform various operations related to face recognition and face mask detection. This documentation provides an overview of the available APIs, how to call them, input guidelines, sample responses, and other relevant information.
How to call the API
Before making API requests, you need to perform a login authentication and obtain an access token. The access token should be included in the authorization header of subsequent API requests. The API endpoints and environments for different operations are provided below.
API Input Guidelines
The Face Match API is used to determine if two images belong to the same person. You can provide two images either by uploading them or by providing their URLs as input to the API.
You can also provide a optional threshold value between 0.05-0.95 to decide which match is False or True. If match percentage is greater than or equal to threshold then True otherwise False.
Endpoint Details
Endpoints | Environment |
|---|---|
https://preproduction.signzy.tech/api/v2/patrons/{patron-id}/facematches | Preproduction |
https://signzy.tech/api/v2/patrons/{patron-id}/facematches | Production |
Request Body Parameters
PARAMETER NAME | Required/Optional | DESCRIPTION |
|---|---|---|
firstImage | Required | first-image-URL |
secondImage | Required | second-image-URL |
threshold | Required | threshold-value |
alignHorizontally | Required | yes|no |
detectMask | Required | URLs-to-detect-mask |
{
"essentials": {
"firstImage": ".....first image URL....",
"secondImage": ".....Second image URL....",
"threshold": "...value between 0.05 to 0.95...(optional)",
"alignHorizontally": "yes|no....(optional)",
"detectMask": [
"...URLs to detect if face is wearing mask..."
]
}
}Request Body Headers
Header Name | Required/Optional | DESCRIPTION |
|---|---|---|
Authorization | Required | access token returned as id field of login request |
Content-Type | Required | application/json |
Code Samples
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://signzy.tech/api/v2/patrons/...patronID.../facematches"
method := "POST"
payload := strings.NewReader(`{"essentials":{"firstImage":"...firstImage..","secondImage":"...secondImage..."}}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Accept", "*/*")
req.Header.Add("Accept-Language", "en-US,en;q=0.8")
req.Header.Add("Authorization", "<Access-Token>")
req.Header.Add("content-type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Sample Response
{
"essentials": {
"firstImage": ".....first image URL....",
"secondImage": ".....Second image URL...."
},
"id": "......id.....",
"patronId": "..patronID....",
"result": {
"verified": "...verified 'true' or 'false'.....",
"message": ".....message.....",
"matchPercentage": ".....match %....",
"maskDetections": [
{
"maskDetected": "...true/false...",
"confidence": "...confidence..."
"url": "...input URL..."
}
]
}
}Response Parameter
Parameter Name | Description |
|---|---|
verified | (boolean): Indicates whether the verification was successful or not. |
message | (string): Message indicating the result of the verification. |
matchPercentage | (string): Percentage of match between the two images. |
maskDetections | (array): Information about mask detection results. |
maskDetected | (boolean): Indicates whether a mask was detected or not. |
confidence | (string): Confidence score for mask detection. |
url | (string): Input URL for mask detection. |
Sample Error
{
"message": "No API key found in request"
}Status Codes
Status Code | Description |
|---|---|
200 | OK |
400 | Bad Request |
401 | Authorization token is invalid |
422 | Unprocessable Entity |
Getting help
Please feel free to contact us if you have any questions, require clarification, or have ideas for how to make the documents or any of our services better.
You can reach out to us at [email protected].