SAFR API to add a person with face image is POST /people. By design, this API will match an existing person before adding a new person. To force SAFR to add a new person record, use the X-RPC-GROUPING-THRESHOLD API header with value of 0 as described below.
Use the following with the post /people API
- API Parameters
- insert=true
- update=false
- Headers
- X-RPC-FACES-GROUPING-THRESHOLD=0
Value of 0 forces SAFR to assume face does not match any other record.
Example:
curl -k -X POST curl "https://127.0.0.1:8081/people?insert=true&update=false" -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
Tip:
SAFR supports a property "externalId" on a person record. You may set this at the time you create a record. Generally this would be set to the unique id that your system uses to identify a person. The GET /people/external/<externalId> API may be used then to retrieve the SAFR person id of a person record which can then be used during the update calls described above.
For more information, please refer to the SAFR REST APIs at https://covi.real.com/docs/index.html