Applicant Face Comparison
Instead of suppling an image to use for the Face Comparison check, you can provide an Applicant ID and use the face stored with this.
This will required steps from the previous page:
- Create a session with Liveness and Face Comparison check
- Create a resource for the Face Capture
Additional steps you will need to take to use an applicant.
- Create an Applicant if you haven't already and add a Face
- Provide the Applicant ID to the session to perform the Face Comparison check
Add Applicant to session
PUT https://api.yoti.com/idverify/v1/sessions/{sessionID}/resources/face-capture/{resourceID}/applicant
const { RequestBuilder, Payload } = require("yoti");
const payload = {
"applicant_id": "<uuid>"
};
const request = new RequestBuilder()
.withBaseUrl("https://api.yoti.com/idverify/v1")
.withPemFilePath("<YOTI_KEY_FILE_PATH>") // file path to PEM file
.withEndpoint("/sessions/{sessionID}/resources/face-capture/{resourceID}/applicant")
.withPayload(new Payload(payload))
.withMethod("PUT")
.withQueryParam("sdkId", "<YOTI_CLIENT_SDK_ID>")
.build();
// get Yoti response
const response = await request.execute();
The sessionID and resourceID will be obtained in steps 1 and 2. The Applicant ID will be obtained from step 3.
Request Body
{
"applicant_id": "<uuid>",
}
Response
There will be no body in the response, only a 200 status code if successful
HTTP/1.1 200 OK
Error codes
If there is an error, we will return an error code and error message. For example
HTTP/1.1 401 Unauthorised request
{
"code": "BAD_TOKEN",
"message": "Cannot authorize your request for the session with the given token"
}
Error code | Description |
---|---|
400 | Bad request - there was an error when validating the request payload. further details will be provided in errors array. See the 400 tab above. |
401 | Cannot authorize your request for the session with the given token |
403 | You may only update Resources that you have created |
404 | No resource found for the sessionId & resourceId provided |
409 | The session has expired |
422 | The media provided is not processable |
503 | The service is unavailable. Further details may be provided in errors array |
Completing the session
The Liveness check will be still need to be completed by the user. Any document checks configured will also need to be completed. The user view should be presented for this. Details on this can be found here.
Retrieving the results
Once the session is completed, you will be able to retrieve the results of the Face Comparison check. See this page comparison for details on how to do this.