Skip to main content

# Applicants

### Create an applicant​

Endpoint: POST /publicapi/api/v2/private/Applicants

Request body:

    {
      "firstName": "string",
      "lastName": "string",
      "phone": "string",
      "email": "string",
      "metadata": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "callbackUrl": "string",
      "sendSms": true,
      "status": 0,
      "verificationMethod": 0
    }

- firstName - applicant's name (optional field)
- lastName - applicant's last name (optional field)
- phone - applicant’s phone number. Make sure that the number specified is valid (optional field)
- email - applicant’s email (optional field)
- metadata - additional information about applicant. Contains 3 fields: additionalProp1, additionalProp2 and additionalProp3. (optional field)
- callbackUrl - URL for redirection after successful verification (optional field)
- sendSms - flag for receiving sms verification links (optional field): false - disabled, true - enabled.
- status - applicant status. 0 - applicant is not verified, 1 - applicant is successfully verified. 2 - verification has "failed" status, 3 - verification canceled (optional field)
- verificationMethod - verification method. 0 - verification via SMS, 1 - manual verification. Default value is 1 (optional field)

Request example:

    curl -X 'POST' \
      'https:/baf.ai/publicapi/api/v2/private/Applicants' \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer sk_3938ab7b-cdbf-4a1a-952b-e3782f061f4b' \
      -H 'Content-Type: application/json' \
      -d '{
      "firstName": "John",
      "lastName": "Dow",
      "phone": "49828585009568",
      "email": "string",
      "referenceId": "string",
      "metadata": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "callbackUrl": "string",
      "sendSms": true,
      "case": [
        {
          "name": 1,
          "value": "string"
        }
      ],
      "status": 0,
      "verificationMethod": 0
    }'

Response example:

Status Code | 200

    {
      "applicantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "validationLink": "https://host/embedded?requestId=c3e5599f-4742-4a60-b511-b65e5707c963",
      "shortValidationLink": "https://host/UA6IB5g"
    }

Possible errors:

Code | Message | Description | Code
400 | Sms sending error. Please check your phone number | Sms sending failed | 120027

### Get a List of Applicants​

The list of applicants can be filtered by time. If you do not set filtering, all created requests will be displayed, starting with the last one.

Endpoint: GET /publicapi/api​/v2​/private​/Applicants

Parameters:

Field name | Description | Value
Page | Page number | From 1 to 2147483647
PageSize | Maximum number of applicants listed on the page | From 1 to 400

The following optional fields can be used for search and sorting:

Field name | Description
CreatedFrom | Lower date limit: dd-mm-yyyy
CreatedTo | Upper date limit: dd-mm-yyyy
SortField | Sorting field. You can specify firstName, lastName, phone, etc.
Order | The sorting order for the selected field. For descending order specify the value: descending. Ascending order is set by default.
TextFilter | Text search

Request example:

    curl -X 'GET' \
      'https:/baf.ai/publicapi/api/v2/private/Applicants?Page=2&PageSize=2' \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer sk_3938ab7b-cdbf-4a1a-952b-e3782f061f4b'

Response example:

Status Code | 200

    {
      "page": 1,
      "pageSize": 3,
      "total": 46,
      "totalPages": 16,
      "items": [
        {
          "applicantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "attemptsCount": 0,
          "lastAttemptId": null,
          "successAttemptId": null,
          "successAttempt": null,
          "firstName": "Test",
          "lastName": "aihv",
          "phone": "+7 982 200-00-00",
          "email": "",
          "referenceId": null,
          "openedLinkTimes": 3,
          "created": "2023-02-06T00:32:22.9260859",
          "accountId": "2860***",
          "validationRequestSettings": null,
          "completed": false,
          "status": 0,
          "statusName": "Pending",
          "attemptsUsed": 0,
          "documentExpired": null,
          "lastValidationResponse": {
            "validationResponseId": 133,
            "created": "2023-11-17T04:40:31.509932",
            "responseStatus": 0,
            "responseStatusName": "Success"
          },
          "hasRiskEvents": false,
          "metadata": {},
          "callbackUrl": "",
          "verificationMethod": 0,
          "cancelInfo": {
            "reasons": [
              {
                "code": 0,
                "message": "string"
              }
            ]
          }
        },
        {
          "applicantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "attemptsCount": 1,
          "lastAttemptId": null,
          "successAttemptId": null,
          "successAttempt": null,
          "firstName": "Testit",
          "lastName": "bvaddv",
          "phone": "+7 982 200-00-00",
          "email": "",
          "referenceId": null,
          "openedLinkTimes": 5,
          "created": "2023-02-06T00:32:39.0455118",
          "accountId": "28g08***",
          "validationRequestSettings": null,
          "completed": true,
          "status": 5,
          "statusName": "FailedAttempt",
          "attemptsUsed": 1,
          "documentExpired": false,
          "lastValidationResponse": {
            "validationResponseId": 134,
            "created": "2023-11-17T04:40:31.509932",
            "responseStatus": 0,
            "responseStatusName": "Success"
          },
          "hasRiskEvents": false,
          "metadata": {},
          "callbackUrl": "https://host/?fromonline",
          "verificationMethod": 0,
          "cancelInfo": null
        },
        {
          "applicantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "attemptsCount": 1,
          "lastAttemptId": null,
          "successAttemptId": null,
          "successAttempt": null,
          "firstName": "testeSelf",
          "lastName": "teste",
          "phone": "+7 952 500 00 00",
          "email": null,
          "referenceId": null,
          "openedLinkTimes": 6,
          "created": "2023-02-09T03:36:04.0500599",
          "accountId": "28608d***",
          "validationRequestSettings": null,
          "completed": true,
          "status": 1,
          "statusName": "Success",
          "attemptsUsed": 1,
          "documentExpired": false,
          "hasRiskEvents": false,
          "lastValidationResponse": {
            "validationResponseId": 135,
            "created": "2023-11-17T04:40:31.509932",
            "responseStatus": 0,
            "responseStatusName": "Success"
          },
          "metadata": {},
          "callbackUrl": null,
          "verificationMethod": 0,
          "cancelInfo": null
        }
      ]
    }

Possible errors:

Code | Message | Description | Code
400 | No sorting by selected property | Wrong sorting field selected | 120026

### Delete an Applicant​

Applicant should be deleted if the user needs to repeat verification.

Endpoint: DELETE /publicapi/api​/v2​/private​/Applicants​/{applicantId}

Parameters:

applicantId

Request example:

    curl -X 'DELETE' \
      'https:/baf.ai/publicapi/api/v2/private/Applicants/3fa85f64-5717-4562-b3fc-2c963f66afa6' \
      -H 'accept: */*' \
      -H 'Authorization: Bearer sk_3938ab7b-cdbf-4a1a-952b-e3782f061f4b'

Response example:

Status Code | 200

Possible errors:

Code | Message | Description | Code
400 | Graphql error: "error message" | Platform returned errors in response to a graphql query | 120029

### Retrieve an applicant by referenceId​

Query to retrieve an applicant by referenceId.

Endpoint: GET /publicapi/api/v2/private/Applicants/ByReferenceId/{referenceId}

Parameters:

referenceId — reference ID аппликанта

Request example:

    curl -X 'GET' \
      'https:/baf.ai/publicapi/api/v2/private/Applicants/ByReferenceId/9cc82182' \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer sk_9cc82182-d300-4783-bce4-cbd7794a7f93'

Response example:

HTTP Code | 200

    {
      "applicantId": "70c0d046-606d-47f8-b191-5c95b1d1a3f2",
      "attemptsCount": 1,
      "lastAttemptId": null,
      "successAttemptId": null,
      "successAttempt": null,
      "firstName": null,
      "lastName": null,
      "phone": null,
      "email": "tramp@baf.ru",
      "referenceId": "refref",
      "openedLinkTimes": 0,
      "created": "2024-08-16T11:34:52.244449",
      "accountId": "28608d66-a571-44ec-94db-04a00143ff51",
      "validationRequestSettings": null,
      "completed": false,
      "status": 5,
      "statusName": "FailedAttempt",
      "attemptsUsed": 1,
      "documentExpired": null,
      "lastValidationResponse": {
        "validationResponseId": 24145,
        "created": "2024-08-16T11:35:15.564344",
        "responseStatus": 1,
        "integrationId": null,
        "responseStatusName": "Fail"
      },
      "hasRiskEvents": false,
      "hasBackgroundRiskEvents": true,
      "metadata": {},
      "callbackUrl": null,
      "verificationMethod": 1,
      "cancelInfo": {
        "reasons": [
          {
            "code": 0,
            "message": "string"
          }
        ]
      }
    }

Possible errors:

HTTP Code | Message | Description | Code
400 | Too many request by reference id: "applicant count" | More than one applicant with the requested referenece id was found | 120049

### Check an applicant status​

Endpoint: GET /publicapi/api/v2/public/Applicants/{applicantId}/Completed

Parameters:

applicantId

Request example:

    curl -X 'GET' \
      'https:/baf.ai/publicapi/api/v2/public/Applicants/3fa85f64-5717-4562-b3fc-2c963f66afa6/Completed' \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer sk_3938ab7b-cdbf-4a1a-952b-e3782f061f4b'

Response example:

Status Code | 200

Possible errors:

Code | Message | Description | Code
404 | Validation request "applicantId" is not completed yet. | The applicant is not in a completed status. | 120025

### Force close an applicant​

Request for forced transfer of an applicant's status to 3 (Canceled)

Endpoint: POST /publicapi/api/v2/public/Applicants/{applicantId}/Complete

Parameters:

applicantId

Request body:

    {
      "reasons": [
        {
          "code": 1,
          "message": "Manual block"
        }
      ]
    }

- code - Block code. It is necessary to specify 1, which means the blocking was done manually.
- message - Message describing the reason for blocking.

The request body can be empty in case it is not required to specify the reason of blocking.

Request example:

    curl -X 'POST' \
      'https:/baf.ru/publicapi/api/v2/public/Applicants/3fa85f64-5717-4562-b3fc-2c963f66afa6/Complete' \
      -H 'accept: text/plain' \
      -H 'Content-Type: application/json-patch+json' \
      -d '{
      "reasons": [
        {
          "code": 1,
          "message": "Manual block"
        }
      ]'

Response example:

Status Code | 200

    {
      "callbackUrl": null
    }

### Search an applicant by ID​

Endpoint: GET /publicapi/api​/v2​/private​/Applicants/{applicantId}

Parameters:

applicantId

Request example:

    curl -X 'GET' \
      'https:/baf.ai/publicapi/api/v2/private/Applicants/3fa85f64-5717-4562-b3fc-2c963f66afa6' \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer sk_3938ab7b-cdbf-4a1a-952b-e3782f061f4b'

Response example:

Status Code | 200

    {
      "applicantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "attemptsCount": 2,
      "lastAttemptId": 133,
      "successAttemptId": 133,
      "successAttempt": {
        "document": null,
        "attemptId": 117,
        "created": "2023-11-17T04:38:04.653858",
        "documentType": null,
        "documentTypeInt": 10,
        "hasRiskEvents": false,
        "status": 0,
        "validationStatus": {
          "expired": null,
          "documentIsValid": null,
          "faceIsValid": true,
          "antiSpoofingIsValid": true,
          "profileAlreadyExists": null,
          "qualityIsValid": true,
          "livenessReflectionIsValid": null,
          "hasBeenBlackListed": false
        },
        "validations": {
          "liveness": {
            "verdict": true,
            "details": [
              {
                "name": "FaceLiveness",
                "verdict": true,
                "score": 0.99,
                "additionalInfo": {
                  "attackType": "none",
                  "attackTypeConfidence": 0.9917428
                }
              }
            ]
          },
          "quality": {
            "verdict": true,
            "details": [
              {
                "name": "FaceQuality",
                "verdict": true,
                "score": 0.53,
                "additionalInfo": null
              }
            ]
          },
          "matching": {
            "verdict": true,
            "details": [
              {
                "name": "FaceMatching",
                "verdict": true,
                "score": 0.0,
                "additionalInfo": null
              }
            ]
          },
          "motionControl": {
            "verdict": false,
            "motionControlInfo": [
              {
                  "pattern": "up",
                  "result": true,
                  "photo_link": "vr.ref-images:motion_control_frame-mcf-26-03-12-04_19_14-32cab-08cbb-8a52b.jpeg"
              },
              {
                  "pattern": "left",
                  "result": false,
                  "photo_link": "vr.ref-images:motion_control_frame-mcf-26-03-12-04_19_14-32cab-08cbb-8a52b.jpeg"
              }
            ]
          }
        }
      },
      "firstName": "John",
      "lastName": "Dow",
      "phone": "1542540505-039",
      "email": "string",
      "referenceId": "string",
      "openedLinkTimes": 0,
      "created": "2023-09-19T10:39:00.0307329",
      "accountId": "28608***",
      "validationRequestSettings": {
        "validationRequestId": "ff039***",
        "faceMatchRegistrationThreshold": 90,
        "faceMatchAuthorizationThreshold": 90,
        "documentValidationPercent": 70,
        "qualityScore": 30,
        "livenessReflectionScore": 30,
        "antiSpoofingPercent": 70,
        "verifyFace": true,
        "isLRSCrossMatchEnabled": true,
        "isOCREnabled": true,
        "isAddressCheckEnabled": true,
        "isFaceRequiredOnDocument": true,
        "isCrossMatchRequired": false,
        "isDMVEnabled": false,
        "isDMVPartialEnabled": false,
        "isIdentiFraudEnabled": false,
        "isIdentiFraudFullCaseEnabled": false,
        "isDmvOrIdentiFraudEnabled": false,
        "isDmvAndIdentiFraudEnabled": false,
        "isDmvOrIdentiFraudPartialEnabled": false,
        "isDmvAndIdentiFraudPartialEnabled": false,
        "isGenderCheckEnabled": false,
        "isAgeCheckEnabled": false,
        "ageYearsDifference": 10,
        "showConsentForm": false,
        "manualIsLivenessCheckEnabled": false,
        "manualIsMatchingCheckEnabled": true,
        "manualIsQualityCheckEnabled": false,
        "autoUnblockEnabled": false,
        "autoUnblockPeriod": "00:02:00",
        "autoUnblockCount": 3
      },
      "completed": true,
      "status": 3,
      "statusName": "Canceled",
      "attemptsUsed": 0,
      "documentExpired": null,
      "lastValidationResponse": {
        "validationResponseId": 133,
        "created": "2023-11-17T04:40:31.509932",
        "responseStatus": 0,
        "responseStatusName": "Success"
      },
      "hasRiskEvents": false,
      "hasBackgroundRiskEvents": true,
      "metadata": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "callbackUrl": null,
      "verificationMethod": 0,
      "cancelInfo": {
        "reasons": [
          {
            "code": 0,
            "message": "string"
          }
        ]
      },
    }

### Update applicant​

Update applicant data

Endpoint: PUT /publicapi/api​/v2​/private​/Applicants/{applicantId}

Parameters:

applicantId

Request body:

    {
      "firstName": "string",
      "lastName": "string",
      "phone": "string",
      "email": "string",
      "referenceId": "string",
      "callbackUrl": "string",
      "metadata": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      }
    }

- firstName - applicant's name (optional field)
- lastName - applicant's last name (optional field)
- phone - applicant’s phone number. Make sure that the number specified is valid (optional field)
- email - applicant’s email (optional field)
- referenceId - (optional field)
- referenceId - (optional field)
- callbackUrl - (optional field)
- metadata - (optional field)

note

An empty line is interpreted as a null value. Namely, to delete a firstName, send a query with an empty string ("") in the firstName field.

Request example:

    curl -X 'PUT' \
      'http:/baf.ai/publicapi/api/v2/private/Applicants/a948fb4d-8320-429d-aff1-37925609c22f' \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer sk_e291909c-687f-43b7-b234-216681350c6c' \
      -H 'Content-Type: application/json-patch+json' \
      -d '{
      "firstName": "string",
      "lastName": "string",
      "phone": "string",
      "email": "string",
      "referenceId": "string",
      "callbackUrl": "string",
      "metadata": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      }
    }'

Response example:

Status Code | 200

Possible errors:

Code | Message | Description | Code
400 | Wrong Applicant data: SendSms enabled. Phone number cannot be null. | Attempt to null the phone when the applicant has sms sending enabled. | 120028

### Get a List of Applicant Verification Attempts​

A request to receive a list of all attempts to verify an applicant by ID.

Endpoint: GET /publicapi/api​/v2​/private​/Applicants/{applicantId}/Attempts

Parameters:

applicantId

Request example:

    curl -X 'GET' \
      'https:/baf.ai/publicapi/api/v2/private/Applicants/3fa85f64-5717-4562-b3fc-2c963f66afa6/Attempts' \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer sk_3938ab7b-cdbf-4a1a-952b-e3782f061f4b'

Response example:

Status Code | 200

    {
      "attempts": [
        {
          "attemptId": 188,
          "created": "2023-09-20T07:51:46.5449834",
          "documentType": "ID",
          "documentTypeInt": 1,
          "hasRiskEvents": false,
          "status": 2,
          "validationStatus": {
            "expired": null,
            "documentIsValid": null,
            "faceIsValid": null,
            "antiSpoofingIsValid": null,
            "profileAlreadyExists": null,
            "qualityIsValid": true,
            "livenessReflectionIsValid": true,
            "hasBeenBlackListed": false
          }
        }
      ]
    }

### Get information about an applicant verification attempt​

The request returns all information about the verification attempt for a specific applicant.

Endpoint: GET /api​/v2​/private​/Applicants/{applicantId}/Attempts/{attemptId}

Parameters:

applicantId

attemptId

Request example:

    curl -X 'GET' \
      'https:/baf.ai/publicapi/api/v2/private/Applicants/3fa85f64-5717-4562-b3fc-2c963f66afa6/Attempts/1' \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer sk_3938ab7b-cdbf-4a1a-952b-e3782f061f4b'

Response example:

Status Code | 200

    {
      "documentFailStatusReasons": [
        "string"
      ],
      "faceFailStatusReasons": [
        "string"
      ],
      "invalidDataErrors": [
        {
          "code": "120058",
          "message": "No faces found on image",
          "description": "string"
        }
      ],
      "dvsResult": {
        "requestId": "3fa85***",
        "documentType": 1,
        "captureMethod": "string",
        "document": {
          "abbr3Country": "string",
          "abbrCountry": "string",
          "address": "string",
          "city": "string",
          "class": "string",
          "country": "string",
          "dob": "string",
          "expires": "string",
          "eyes": "string",
          "familyName": "string",
          "firstName": "string",
          "fullName": "string",
          "gender": "string",
          "hair": "string",
          "height": "string",
          "id": "string",
          "idType": "string",
          "issued": "string",
          "middleName": "string",
          "postalBox": "string",
          "state": "string",
          "issuedBy": "string",
          "template": "string",
          "weight": "string",
          "zip": "string",
          "privateName": "string"
        },
        "parsedData": {
          "isOcrSuccess": true,
          "isPdf417Success": true,
          "isMrzSuccess": true,
          "isShuftiSuccess": true,
          "isAntiSpoofingSuccess": true
        },
        "documentVerificationResult": {
          "status": 0,
          "totalConfidence": 0,
          "validationTests": [
            {
              "rawResponse": "string",
              "name": "string",
              "displayName": "string",
              "reason": "string",
              "effect": 0,
              "values": [
                {
                  "score": 0,
                  "effect": 0,
                  "fieldName": "string",
                  "effectString": "string"
                }
              ],
              "effectString": "string",
              "status": 0,
              "statusString": "string"
            }
          ],
          "verificationConfidence": {
            "abbr3Country": 0,
            "abbrCountry": 0,
            "address": 0,
            "city": 0,
            "class": 0,
            "country": 0,
            "dob": 0,
            "expires": 0,
            "eyes": 0,
            "familyName": 0,
            "firstName": 0,
            "fullName": 0,
            "gender": 0,
            "hair": 0,
            "height": 0,
            "id": 0,
            "idType": 0,
            "issued": 0,
            "issuedBy": 0,
            "middleName": 0,
            "postalBox": 0,
            "state": 0,
            "template": 0,
            "weight": 0,
            "zip": 0,
            "ssn": 0,
            "privateName": 0
          }
        },
        "faceVerificationResult": {
          "antiSpoofing": 0,
          "quality": 46,
          "confidence": 0,
          "livenessReflectionConfidence": 90
        }
      },
      "validations": {
        "liveness": {
          "verdict": true,
          "details": [
            {
              "name": "FaceLiveness",
              "verdict": true,
              "score": 0.99,
              "additionalInfo": {
                "attackType": "none",
                "attackTypeConfidence": 0.9917428
              }
            }
          ]
        },
        "quality": {
          "verdict": true,
          "details": [
            {
              "name": "FaceQuality",
              "verdict": true,
              "score": 0.53,
              "additionalInfo": null
            }
          ]
        },
        "matching": {
          "verdict": true,
          "details": [
            {
              "name": "FaceMatching",
              "verdict": true,
              "score": 0.0,
              "additionalInfo": null
            }
          ]
        },
        "motionControl": {
          "verdict": false,
          "motionControlInfo": [
            {
                "pattern": "up",
                "result": true,
                "photo_link": "vr.ref-images:motion_control_frame-mcf-26-03-12-04_19_14-32cab-08cbb-8a52b.jpeg"
            },
            {
                "pattern": "left",
                "result": false,
                "photo_link": "vr.ref-images:motion_control_frame-mcf-26-03-12-04_19_14-32cab-08cbb-8a52b.jpeg"
            }
          ]
        }
      },
      "similarApplicants": {
        "ids": [
          "be9561bb-3c0b-426d-acac-7d2c11825af5"
        ]
      },
      "mobilePhoneModel": "string",
      "mobilePhoneOS": "string",
      "captureMethod": "string",
      "requestIpAddress": "string",
      "created": "2023-09-20T08:37:41.799Z",
      "documentType": "string",
      "documentTypeInt": 0,
      "hasRiskEvents": true,
      "status": 0,
      "validationStatus": {
        "expired": true,
        "documentIsValid": true,
        "faceIsValid": true,
        "antiSpoofingIsValid": true,
        "profileAlreadyExists": true,
        "qualityIsValid": true,
        "livenessReflectionIsValid": true,
        "hasBeenBlackListed": false
      },
      "content": {
        "livenessReflectionVideoLink": "string",
        "livenessActiveVideoLink": "string",
        "backOrSecondImageBase64": "string",
        "faceImageBase64": "string",
        "frontImageBase64": "string",
        "trackString": "string"
      },
      "riskEvents": [
        {
          "created": "2024-08-14T10:28:56.458Z",
          "riskNumber": 0,
          "riskName": "string",
          "isActive": true
        }
      ],
      "applicantId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "faceSampleId": "4ba75***",
      "attemptId": 0
    }

Possible errors:

Code | Message | Description | Code
400 | DVS response Error: "ex.Message" | Failed to deserialize json response from DVS | 120030

### Resend the Link to Verify the Applicant​

The request allows you to resend the verification link to the applicant.

Endpoint: POST /api​/v2​/private​/Applicants/{applicantId}/ReNotify

Parameters:

applicantId

Request example:

    curl -X 'POST' \
      'https:/baf.ai/publicapi/api/v2/private/Applicants/3fa85f64-5717-4562-b3fc-2c963f66afa6/ReNotify' \
      -H 'accept: */*' \
      -H 'Authorization: Bearer sk_3938ab7b-cdbf-4a1a-952b-e3782f061f4b' \
      -d ''

Response example:

Status Code | 200

Possible errors:

Code | Message | Description | Code
400 | SMS sending disabled for applicant | Sending sms is turned off for applicant | 120027

### Get Images From an Applicant Verification Attempt​

The request returns images from a verification attempt for a specific applicant.

Endpoint: GET /api​/v2​/private​/Applicants/{applicantId}/Attempts/{attemptId}/Images

Parameters:

applicantId

attemptId

Request example:

    curl -X 'GET' \
      'https:/baf.ai/publicapi/api/v2/private/Applicants/3fa85f64-5717-4562-b3fc-2c963f66afa6/Attempts/1/Images' \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer sk_3938ab7b-cdbf-4a1a-952b-e3782f061f4b'

Response example:

Status Code | 200

    {
      "livenessReflectionVideoLink": "string",
        "faceSampleObjectData": {
        "bbox": [
          0.35859375,
          0.2708333333333333,
          0.67109375,
          0.8444444444444444
        ]
      },
      "livenessActiveVideoLink": "string",
      "backOrSecondImageBase64": "string",
      "faceImageBase64": "string",
      "frontImageBase64": "string",
      "trackString": "string"
    }

Possible errors:

Code | Message | Description | Code
413 | You do not have a permission to review images. | Photo is not available for viewing. | 120032
413 | Allowed time to review these images is expired. | Photo availability time limit is exceeded. | 120032

### Download the original photo of the attempt​

The request returns the original photo of the attempt that was used for registration / authorization in the system.

Endpoint: GET /publicapi/api​/v2​/private​/Applicants/{applicantId}/Attempts/{attemptId}/RawImage

Parameters:

applicantId attemptId

Request example:

    curl -X 'GET' \
      'http:/baf.ai/publicapi/api/v2/private/Applicants/a948fb4d-8320-429d-aff1-37925609c22f/Attempts/6562/RawImage' \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer sk_e291909c-687f-43b7-b234-216681350c6c'

Response example:

Status Code | 200

Image file

Possible errors:

Код | Сообщение | Описание | Код
400 | Photo obtain error | Failed to retrieve the original image from OMNI Platform | 160001
400 | Content not found | FaceSampleId from attempt equal to null | 120031

### Download Liveness Reflection video from an Applicant Verification Attempt​

The request returns Liveness Reflection video from a verification attempt for a specific applicant.

Endpoint: GET /api​/v2​/private​/Applicants/{applicantId}/Attempts/{attemptId}/Video

Parameters:

applicantId

attemptId

Request example:

    curl -X 'GET' \
      'http:/baf.ai/publicapi/api/v2/private/Applicants/a948fb4d-8320-429d-aff1-37925609c22f/Attempts/6562/Video' \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer sk_e291909c-687f-43b7-b234-216681350c6c'

Response example:

Status Code | 200

Video file

Possible errors:

Code | Message | Description | Code
400 | Validation response does not contain a video | No video reference found in validationResponse | 120033

### Download motion control video from an Applicant Verification Attempt​

The request returns motion control video from a verification attempt for a specific applicant.

Endpoint: GET /api​/v2​/private​/Applicants/{applicantId}/Attempts/{attemptId}/LivenessActionVideo

Parameters:

applicantId

attemptId

Request example:

    curl -X 'GET' \
      'http:/baf.ai/publicapi/api/v2/private/Applicants/a948fb4d-8320-429d-aff1-37925609c22f/Attempts/6562/LivenessActionVideo' \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer sk_e291909c-687f-43b7-b234-216681350c6c'

Response example:

Status Code | 200

Video file

Possible errors:

Code | Message | Description | Code
400 | Validation response does not contain a video | No video reference found in validationResponse | 120033

### Unlock or open the applicant​

This request allows you to unlock or open the applicant. If the applicant is in Failed status, the number of attempts spent is reset.

Endpoint: POST /api/v2/private/Applicants/{applicantId}/Open

Parameters:

applicantId

Request example:

    curl -X 'POST' \
      'http:/baf.ai/publicapi/api/v2/private/Applicants/dcf431c7-786a-4097-83e0-ba9b6dc00e76/Open' \
      -H 'accept: */*' \
      -H 'Authorization: Bearer sk_e291909c-687f-43b7-b234-216681350c6c' \
      -d ''

Response example:

Status Code | 200

Possible errors:

Code | Message | Description | Code
400 | Request already unblocked | Error occurs when attempting to unlock an unlocked applicant | 150002

### Update the applicant's registration photo​

This request allows you to update the applicant's registration photo. All subsequent authorizations will be compared to the new photo.

Endpoint: POST /api/v2/private/Applicants/{applicantId}/UpdateMainPhoto

Parameters:

applicantId

Request example:

    curl -X 'POST' \
      'http:/baf.ai/publicapi/api/v2/private/Applicants/dcf431c7-786a-4097-83e0-ba9b6dc00e76/UpdateMainPhoto' \
      -H 'accept: */*' \
      -H 'Content-Type: application/json-patch+json' \
      -d '{"faceImageBase64": "string"}'

Response example:

Status Code | 200

Possible errors:

Code | Message | Description | Code
400 | Applicant has not yet registered | Attempting to update a photo from an unregistered applicant | 150006
400 | Graphql error: "error message" | Platform returned errors in response to a graphql query | 120029

### Confirm registration​

This request allows you to confirm the registration.

Endpoint: POST /api/v2/private/Applicants/{applicantId}/ConfirmRegistration

Parameters:

applicantId

Request example:

    curl -X 'POST' \
      'https:/baf.ru/publicapi/api/v2/private/Applicants/8b01d250-cb74-49a3-9bcb-d65770ebcd9f/ConfirmRegistration' \
      -H 'accept: */*' \
      -H 'Authorization: Bearer sk_fc2c0d81-7e9b-4f8f-b0aa-cc2d97bfa87c'

Response example:

Status Code | 200

Possible errors:

Code | Message | Description | Code
400 | Applicant does not have a register attempt for confirmation | Attempt to confirm registration for applicant without successful registration attempt | 1100002
400 | Applicant is already registered | Attempt to confirm registration of an already registered applicant | 150001

### Retrieving motion control data​

This request retrieves motion control data along with a base64-encoded photo of any attempt.

Endpoint: GET /api/v2/private/Applicants/{applicantId}/Attempts/{attemptId}/GetMotionControlContent

Parameters:

applicantId attemptId

Request example:

    curl -X 'GET' \
      'https:/baf.3divi.ru/publicapi/api/v2/private/Applicants/afc05551-b75a-4e1e-9c30-63d5fcc59a0b/Attempts/321049/GetMotionControlContent' \
      -H 'accept: text/plain' \
      -H 'Authorization: Bearer sk_fc2c0d81-7e9b-4f8f-b0aa-cc2d97bfa87c'

Response example:

Status Code | 200

    {
      "patterns": [
        {
          "rawPhoto": "base64_image",
          "pattern": "left",
          "result": true,
          "photo_link": "vr.ref-images:motion_control_frame-mcf-26-03-12-04_19_14-32cab-08cbb-8a52b.jpeg"
        },
        {
          "rawPhoto": "base64_image",
          "pattern": "right",
          "result": true,
          "photo_link": "vr.ref-images:motion_control_frame-mcf-26-03-12-04_19_14-32cab-08cbb-8a52b.jpeg"
        }
      ]

Possible errors:

Code | Message | Description | Code
400 | Validation response or request not found | Invalid applicantId or attemptId | 120024

### Retrieving content via an S3 link.​

This request allows you to retrieve content from an attempt in byte format via an S3 link.

Endpoint: GET /api/v2/private/Applicants/{applicantId}/Attempts/{attemptId}/{contentLink}

Parameters:

applicantId attemptId contentLink

Request example:

    curl -X 'GET' \
      'https:/baf.3divi.ru/publicapi/api/v2/private/Applicants/afc05551-b75a-4e1e-9c30-63d5fcc59a0b/Attempts/321044/vr.videos%3Amotion_control_video-26-04-01-06_03_07-no-parent-ea6d9-9571b.webm/GetAttemptContentByLink' \
      -H 'accept: */*' \
      -H 'Authorization: Bearer sk_6ae3d0d3-b477-4962-96e5-6e84df4bd9e0'

Response example:

Status Code | 200

Content file

Possible errors:

Code | Message | Description | Code
400 | Validation response or request not found | Invalid applicantId or attemptId | 120024
400 | Content not found by link | Invalid link to content | 120049