Non-Native Apps
WebView Flow Overview
- Get a verification URL for a user from AiPrise, load it in the WebView.
- Once the verification is completed in the WebView, it will redirect to a URI of your choice.
- Query the verification results.
Getting the URL
For the user verification, you will first have to request a verification URL from AiPrise. Your WebView is then going to load this URL.
Use the Get User Verification URL API to get the URL. In the request, you send us the template_id (provided to you by AiPrise) and a redirect_uri to which the WebView will redirect after the verification is complete. You can also optionally send any user data like name, date of birth etc. that you want to verify.
Following shows a sample cURL request to get the Verification URL. More here.
curl --request POST \
--url https://api-sandbox.aiprise.com/api/v1/verify/get_user_verification_url \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <YOUR_API_KEY>' \
--data '
{
"redirect_uri": "https://somecompany.com",
"template_id": "cc82dfa0-6134-4b8a-b6ea-19d9ad8704ac",
"user_data": {
"first_name": "Steven",
"middle_name": "Paul",
"last_name": "Jobs"
}
}
'
NOTE: The verification URL is only active for 30 minutes.
Sample Response:
{
"message": "success",
"verification_url": "https://onboard-sandbox.aiprise.com/?verification_session_id=4dec3ec0-4214-4fe3-9a33-64bd176dd355"
}
Redirection
Once the verification is completed from AiPrise, we will redirect it to the redirect_uri you sent us and add the verification session id to its query parameter.
SAMPLE REDIRECTION URI: https://somecompany.com/?verification_session_id=4dec3ec0-4214-4fe3-9a33-64bd176dd355
Getting Verification Results
You can then get the verification results using Get User Verification Result
Following shows a sample cURL request to get the verification result.
curl --request GET \
--url https://api-sandbox.aiprise.com/api/v1/verify/get_user_verification_result/4dec3ec0-4214-4fe3-9a33-64bd176dd355 \
--header 'Accept: application/json' \
--header 'X-API-KEY: <YOUR_API_KEY>'
Sample response:
{
"aiprise_summary": {
"reasons": [
"Result fetched from <API_ID> Response."
],
"verification_result": "Approved"
},
"api_responses": {
"API_ID" : <RAW_API_RESPONSE>
}
...
}
Updated 10 months ago