To make the register operation, you must use the enroll method, whose URL is https://api.biopassid.com/multibiometrics/enroll. The request body consists of a Person object, which contains a CustomID string, that contains a unique value that will be used to identify the user, a Fingers array, that contains the fingerprint images in the format of a base64 string, and a Face array, that contains the images of the user’s face.

To make the request successful, just one fingerprint or face image needs to be inserted into the request body. If none is passed, the error Invalid JSON format will be returned.

An example of how the request body would look like is shown below:

{
  "Person": {
    "CustomID": "1234",
    "Face": [
      {
        "Face-1": "/9j/4AAQSkZJRgABAQAAAQABAAD/..."
      }
    ]
  }
}

The request header is where must be inserted the content type and your subscription key, replacing <API-KEY>. An example of how the header must look like can be seen below:

{
  'Content-Type': 'application/json',
  'Ocp-Apim-Subscription-Key': '<API-KEY>'
}

Lastly, in the request, the specification that it’s a POST method, the URL, the header, and the body described above must be passed as parameters. An example of how the code for this request would look like is shown below, written in Python, but that can be seen in several other programming languages in our documentation:

import http.client
import json

conn = http.client.HTTPSConnection("hml-api.biopassid.com")
payload = json.dumps({
  "Person": {
    "CustomID": "1234",
    "Face": [
      {
        "Face-1": "/9j/4AAQSkZJRgABAQAAAQABAAD/..."
      }
    ]
  }
})
headers = {
  'Content-Type': 'application/json',
  'Ocp-Apim-Subscription-Key': '<API-KEY>'
}
conn.request("POST", "/multibiometrics/enroll", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

The response that will be received in case the operation is successful is made of a person object, which consists of the ClientID field, that represents the identification in the databased used for the client, a CustomID field, that represents the identifier for the user as given in the request, and a BioPassID, that represents the unique identifier for the user in the system.

In case an error is returned, make sure the text in JSON format was written correctly. If you receive a message with the code 200 (OK), that means your request was successful and, thus, you can keep going with the next requests. The system response message for the example given can be seen below:

{
    "Person": {
        "ClientID": "1628692218558x176807293303153250",
        "CustomID": "1234",
        "BioPassID": "1648"
    }
}