This article explains how to add more than one face image to an existing identity.


To add a new face image to existing identity, use following two properties:

  • URL Parameters:
    • insert=true
    • update=true
    • mergeWith=<person ID to add face image to>
  • Headers:
    • X-RPC-FACES-GROUPING-THRESHOLD=4


The process to follow is:

  1. Obtain person Id of the person record new face will be added
    Tip: Use GET /people/external/<externalId> to obtain the person ID of a person an external database (where the external id would be added when person record was initially created).
  2. Call POST /people API with the new face image and specify the query parameters and headers described above


The value of X-RPC-FACES-GROUPING-THRESHOLD must be equal fo 0 which forces SAFR  to match any existing faces (most importantly the target face which is presumably the same person).


Note: This behavior creates TWO DIFFERENT identities and then links to two into a parent/child relationship.  In the SAFR People Window, it will appear as one identity with faces nested underneath it.  One of the identities is set as the "root" identity with the rootPersonId. 


Example:

curl -k -X POST curl "https://127.0.0.1:8081/people?update=true&insert=true&merge-with=0c4e0e57-7edf-4ffb-a122-660da7fe13a1" -H "accept: application/json;charset=UTF-8" -H "X-RPC-DIRECTORY: main" -H "X-RPC-FACES-GROUPING-THRESHOLD: 0" -H "X-RPC-AUTHORIZATION: $USER:$PASS" -H "Content-Type: image/jpeg" --data-binary @new_face.jpg