Skip to main content

Responses

The Shufti Pro SDK will send you two types of responses if a request is made. First is the HTTP response sent against your request, and the second is the webhook response. Both HTTP and webhook responses will be in the JSON format with header application/json The response header also includes a key Signature. This key is used for validating the source of response. Be sure to validate the request by generating signature and matching it with Signature value from the response header.


sample-response
//Content-Type: application/json

{
"access_token": "474f51710fb60fdf9688f44ea0345eda28a9f55212a83266fb5d237babff2"
"reference":"17374217",
"event":"request.pending",
"verification_url":"https://app.shuftipro.com/biometric/verification/474f51710fb60fdf9688f44ea0345eda28a9f55212a83266fb5d237babff2"
}

Verification Response

Responses will contain the following parameters:


ParametersDescription
referenceYour unique request reference, which you provided us at the time of request, so that you can identify the response in relation to the request made.
eventsThis is the request event which shows status of request. Event is changed in every response. Please consult Events for more information.
errorWhenever there is an error in your request, this parameter will have the details of that error.
tokenThis is the unique request token of the request.
verification_urlA URL is generated for your customer to verify there documents. It is only generated in case of on-site request.
verification_resultIt is only returned in case of a valid verification. This includes results of each verification.
1 means accepted
0 means declined
null means not processed
Check verification.accepted and verification.declined responses in Events section for a sample response.
verification_dataIt is only returned in case of a valid verification. This object will include the all the gathered data in a request process. Check verification.accepted and verification.declined responses in Events section for a sample response.
infoThis object will be returned in case of verification.accepted or verification.declined. It contains the following keys:
Agent provides information about the device and browser of the end-user.
Geolocation provides information about the geographical location of the end-user.
For Details on info object go to Info
declined_reasonThis parameter will have the reason due to which a verification has been declined, and is only returned in this case in the callback URL.
declined_codesThis array contains status codes of all declined verification reasons. It will return only for verification.declined.
services_declined_codesThis object contains status codes of declined reasons for each service separately. Each service object will contain an array of status codes for declined reasons specific to that service. It will return only for verification. declined.

caution

Callback response will be sent on the callback_url provided in the request callback_url parameter.


Status Response

The Shufti Pro Verification API will send a JSON response if a status request is made. Make sure to validate the request by generating signature and matching it with Signature value from response header.


ParametersDescription
referenceYour unique request reference, which you provided us at the time of request, so that you can identify the response in relation to the request made.
eventThis is the request event which shows status of request. Event is changed in every response.
Please consult Events for more information.
proofThis contains all the proofs that were used to verify data. The Proof URLs returned are temporary and valid for 15 minutes only.

Note: verification_video It contains the video URL and will be returned only for the video recorded on-site.
verification_dataThis contains all the data used for verification. This will only be returned in case of verification.accepted or verification.declined.
verification_resultThis is the complete result of the verification. 1 stands for verified, 0 for not verified and null for no verification performed. This will only be returned in case of verification.accepted or verification.declined.
infoThis object will be returned in case of verification.accepted or verification.declined. It contains the following keys:
Agent provides information about the device and browser of the end-user.
Geolocation provides information about the geographical location of the end-user.
For Details on info object go to Info
declined_reasonThis key will only be returned when event is verification.declined. This will contain the reason why verification was declined.
declined_codesThis array contains status codes of all declined verification reasons. It will return only for verification.declined.
services_declined_codesThis object contains status codes of declined reasons for each service separately. Each service object will contain an array of status codes for declined reasons specific to that service. It will return only for verification. declined.

caution

request.invalid response with HTTP status code 400 means the request is invalid.


status-response
//Content-Type: application/json
//Signature: NmI4NmIyNzNmZjM0ZmNl

{
"reference" : "17374217",
"event" : "verification.accepted",
"proof" : {
"face": {
"proof": "https://ns.shuftipro.com/api/pea/65c1cf23bc0ed5a25613539f5cn3bebc0d566caa"
},
"document": {
"proof": "https://ns.shuftipro.com/api/pea/35c1cf23bc0ed5a25613539f5cn3bebc0d566cab"
},
"verification_video":"https://ns.shuftipro.com/api/pea/65c1cf23bc0ed5a25613535f5cn3bebc0d566ca4"
},
"verification_data": {
"document": {
"issue_date": "1990-01-01",
"selected_type": [
"id_card"
],
"supported_types": [
"id_card"
]
},
},
"verification_result": {
"document": {
"issue_date": 1,
"document_visibility": 1,
"document_must_not_be_expired": 1,
"document": 1,
"document_country": 1,
"selected_type": 1
},
"face": 1
},
"info": {
"agent": {
"is_desktop": true,
"is_phone": false,
"useragent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
"device_name": "Macintosh",
"browser_name": "",
"platform_name": "OS X - 10_14_0"
},
"geolocation": {
"host": "212.103.50.243",
"ip": "212.103.50.243",
"rdns": "212.103.50.243",
"asn": "9009",
"isp": "M247 Ltd",
"country_name": "Germany",
"country_code": "DE",
"region_name": "Hesse",
"region_code": "HE",
"city": "Frankfurt am Main",
"postal_code": "60326",
"continent_name": "Europe",
"continent_code": "EU",
"latitude": "50.1049",
"longitude": "8.6295",
"metro_code": "",
"timezone": "Europe/Berlin"
}
}
}

Delete Request Response

The Shufti Pro Verification API will send a JSON response if a delete request is made. Make sure to validate the request by generating signature and matching it with Signature value from response header.


ParametersDescription
referenceYour unique request reference, which you provided us at the time of request, so that you can identify the response in relation to the request made.
eventThis is the request event which shows status of request. Event is changed in every response.

Please consult Events for more information.


caution

Note: request.invalid will be returned in case of invalid reference provided or the request is already deleted.


delete-request-response
//Content-Type: application/json
//Signature: NmI4NmIyNzNmZjM0ZmNl

{
"reference": "17374217",
"event": "request.deleted"
}

Access Token Response

Responses will contain the following parameters:


ParametersDescription
referenceYour unique request reference, which you provided us at the time of request, so that you can identify the response in relation to the request made.
eventsThis is the request event which shows status of request. Event is changed in every response. Please consult Events for more information.
errorWhenever there is an error in your request, this parameter will have the details of that error.
access_tokenThis is the unique access token of the request.
verification_urlA URL is generated for your customer to verify their documents.
verification_resultIt is only returned in case of a valid verification. This includes results of each verification.
1 means accepted
0 means declined
null means not processed
Check verification.accepted and verification.declined responses in Events section for a sample response.
verification_dataIt is only returned in case of a valid verification. This object will include the all the gathered data in a request process. Check verification.accepted and verification.declined responses in Events section for a sample response.
declined_reasonThis parameter will have the reason due to which a verification has been declined, and is only returned in this case in the webhook URL.
declined_codesThis array contains status codes of all declined verification reasons. It will return only for verification.declined.
services_declined_codesThis object contains status codes of declined reasons for each service separately. Each service object will contain an array of status codes for declined reasons specific to that service. It will return only for verification. declined.

caution

Webhook response will be sent on the webhook_url provided in the request webhook_url parameter.


Callback method Response

Responses will contain the following parameters:


ParametersDescription
statusThis is the request status. Status is changed in every response.Please consult Callback Method Status for more information.
reasonThis parameter will have the reason due to which a verification has been declined.

callback-method-response
{
"status": "Enrolled",
"reason": "face"
}

Response Signature

Every HTTP and Callback response will be in application/JSON with a key Signature in the header. It can be used to validate the source of the request. Make a signature using the following procedure:

  1. Concatenate Secret Key at the end of the raw response string. (i.e. response + secret_key).
  2. Take SHA256 of concatenated string.
  3. Match the SHA256 string with Signature value from the header of the response.

In short, make signature as mentioned format and match it with the signature provided in the header in Signature key.

hash('sha256', response . your_secret_key)

The clients who are registered with shuftipro after 15th March, 2023. They need to make the signature using the following procedure.

  1. Take SHA256 of Secret Key string.
  2. Concatenate hashed Secret Key at the end of the raw response string. (i.e. response + hash('sha256', secret_key)).
  3. Take SHA256 of concatenated string.
  4. Match the SHA256 string with Signature value from the header of the response.
hash('sha256', response . hash('sha256', secret_key))

HTTP Status Codes

Shufti Pro Verification API uses conventional HTTP response codes to indicate the success or failure of an API request. Every response is generated in JSON with a specific HTTP code.

Following is a list of HTTP codes that are generated in responses by Shufti Pro Verification API.


HTTP codeHTTP messageMessage
200OKsuccess
400Bad RequestBad Request: one or more parameter is invalid or missing
401UnauthorizedUnauthorized: invalid signature key provided in the request
402Request FailedInvalid request data: missing required parameters
403ForbiddenForbidden: service not allowed
404Not FoundResource not found
409ConflictConflicting data: already exists
429Too Many RequestsToo Many Attempts.
500Server ErrorInternal Server Error
504Gateway TimeoutServer error
524Timeout from CloudflareUnofficial Server Error

Response Events

Events are sent in responses that show the status of the request. These events are sent in both HTTP and callback responses.


EventdescriptionHTTP ResponseCallback Response
request.pendingRequest parameters are valid and verification url is generated in case of on-site verification.YesYes
request.invalidRequest parameters provided in request are invalid.YesNo
verification.cancelledRequest is cancelled by the user. This event occurs when end-user disagrees to terms and conditions before starting verifications.YesYes
request.timeoutRequest has timed out after a specific period of time.
The onsite request will Time Out after 60 minutes.
NoYes
request.unauthorizedRequest is unauthorized. The information provided in authorization header is invalid.YesNo
verification.acceptedRequest was valid and accepted after verification.YesYes
verification.declinedRequest was valid and declined after verification.YesYes
verification.status.changedRequest status has been updated.NoYes
request.deletedRequest has been deleted.YesYes
review.pendingDocuments are collected and request is pending for client to review and Accept/Decline.YesYes

caution

In case of off-site verification, verification.accepted or verification.declined is returned in event when request is valid after verification. In case of verification.status.changed a callback is sent to notify the client that the verification status has been updated.


request.pending
{
"reference": "17374217",
"event": "request.pending",
"verification_url": "https://app.shuftipro.com/process/verification/RPQ8hwPE3cdHKho2wjK7CVQJCQxNx5Rwmb81k3ediXLSWhQM5QibGBWOSgCVjZJd",
"email": "[email protected]",
"country": "GB"
}