curl -X POST https://api-gateway-admin.trulioo.com/embedids/tokens -H 'cache-control: no-cache' -H 'content-type: application/json' -H 'x-trulioo-api-key: YOUR_API_KEY_(BE)_GOES_HERE' -d '{ "publicKey": "YOUR_TRIAL_KEY_(FE)_GOES_HERE" }'
Installation Free Version
Installation not your thing? Read Add identity verification and KYC to your digital onboarding process in 10 minutes to get EmbedID up and running without installing anything.
The following is the call your server needs to make:
curl -X POST https://api-gateway-admin.trulioo.com/embedids/tokens -H 'cache-control: no-cache' -H 'content-type: application/json' -H 'x-trulioo-api-key: YOUR_API_KEY_(BE)_GOES_HERE' -d '{ "publicKey": "YOUR_TRIAL_KEY_(FE)_GOES_HERE" }'
If successful, you will see the following response:
{"accessToken":"ACCESS_TOKEN"}
npm install trulioo-embedid-middleware
npm install express
Why install express? The trulioo-middleware SDK is an express middleware so depends on express.
You can then add the following js to your backend to invoke the middleware and generate an Access Token.
const truliooMiddleware = require('trulioo-embedid-middleware')({ apiKey: “YOUR_API_KEY_(BE)_GOES_HERE” }); const express = require('express'); const app = express(); const port = 8080; app.use(truliooMiddleware) app.listen(port, () => console.log('Example app listening on port ${port}!'));
When this backend.js is running it will be listening on Port 8080 for EmbedID to make a request, which we will see in the next step.
<div id="trulioo-embedid"></div> <!-- This script renders the form for the div above --> <script type="text/javascript" src="https://js.trulioo.com/latest/main.js"></script> <!-- Initialize your form here with your Frontend (FE) key --> <script> // Handle the response of EmbedID after form submits function handleResponse(e) { console.log('handleResponse', e); } const publicKey = 'Trial Key (FE)_OR_Live Key (FE)'; // Public Key // const accessTokenURL = 'http://localhost:8080'; new TruliooClient({ publicKey, // accessTokenURL, handleResponse }); </script>
field | Required? | Description |
---|---|---|
publicKey | Yes | This is the key you want to use for rendering your form. Trial Key (FE) Use for trial requests (eg during development). These are only test data requests so you won’t be charged. Try verifying as a test entity to see it in action. Live Key (FE) Use for your production requests. You will be charged for these transactions, see our pricing page for more details. |
accessTokenURL | No | EmbedID assumes you are running your Frontend code (Step 1) and Backend Code (Step 2) on the same port. If you are running them separately, for example you are testing on localhost, use accessTokenURL to specify where your Backend is running. It should just be the baseurl as our script will automatically append `/trulioo-api/embedids/tokens/:publicKey` to accessTokenURL. accessTokenURL = '${location of server}' for example 'http://localhost:8080' |
handleResponse | No | This is the callback for where the result of a verification will be posted. See Section Understanding A Verify Response for how to process this response |
<div id="loading-overlay" style=" background-color: white; height: 100vh; width: 100vw; display: block; position: absolute; z-index: 2">Loading...</div> <div id="trulioo-embedid" style="z-index: 1"></div>
function onInitialRenderComplete(e) { document.getElementById('loading-overlay').style.visibility = "hidden"; if (e.status !== 200 || e.statusText !== "Success") { console.log('@onInitialRenderComplete', e); } }
Status Code | Status Text | Variables passed into TruliooClient |
---|---|---|
200 | Success | Valid publicKey with valid accessToken or accessTokenURL |
401 | Error | Invalid publicKey, accessToken or accessTokenURL |
Now that your Experience is up and running you should test it out! We provide Test Entities specifically for this.
Individual with Match result:
000568791
8/4/1988
0812319884104
802-660-9697
18 - 420 9th Avenue,
New York, NY
10001
Individual with NoMatch result:
309-23-0000
10/11/1981
0922870874358
812-472-7518
2649 Lucy Lane,
Fredericksburg, IN
47120
Individual with Watchlist Hit:
000568791
8/4/1988
0812319884104
221-214-4456
1111 West Kagy Boulevard,
Bozeman, MN
90010
Scan the QR code on your mobile device to launch document capture in sandbox mode. Follow the instructions on screen to capture an image of any document.
This will show you how the capture process will work for your Users. When you're instructed to, come back to your desktop and click ‘Next’.
Note: We won't send your image captures; only a fake/placeholder image instead.
When an end user (i.e. your customer) verifies themselves through EmbedID, an Experience Transaction ID is output to the handleResponse callback. You can use this Experience Transaction ID to get both the data that was entered by the user, as well as their verification result for every part of the verification that took place. The data entered by the user will only be available for 72 hours after the form submission.
Note: All user entered data is permanently deleted from Trulioo's servers after 72 hours.
The handleResponse Callback should pass the Experience Transaction ID to your backend so you can securely make the call.
Note: The handleResponse Callback will have status code "200" and status text "ok", if the transaction is a success. In the case of an error, an appropriate status code and text will be returned and experienceTransactionID will be undefined.
curl -X GET https://gateway.trulioo.com/experienceTransaction/{experienceTransactionId} -H 'cache-control: no-cache' -H 'content-type: application/json' -H 'x-trulioo-api-key: YOUR_API_KEY_(BE)_GOES_HERE'
{
experienceTransactionId: '...',
timestamp: 1234567,
transactionResult: 'match',
steps: [{
name: 'IDVStep',
result: 'match',
inputData: {...}
}]
}
Call GET https://gateway.trulioo.com/experienceTransaction/{experienceTransactionId}/detailedResult to get all available data for the result of the verification.
curl -X GET https://gateway.trulioo.com/experienceTransaction/{experienceTransactionId}/detailedResult -H 'cache-control: no-cache' -H 'content-type: application/json' -H 'x-trulioo-api-key: YOUR_API_KEY_(BE)_GOES_HERE'
{
"experienceTransactionId": "...",
"status": "complete",
"transactionResult": "match",
"steps": [
{
"stepName": "IDVStep_OR_DocVStep",
"result": "match",
"transactionRecordId": "...",
"transactionId": "...",
"timestamp": 1234567,
"inputFields": [...],
"errors": [],
"rule": {
"RuleName": "RuleName",
"Note": "The rule that defines whether result is match or nomatch"
},
"datasourceResults": [
{
"DatasourceName": "DatasourceName",
"DatasourceFields": [],
"AppendedFields": [],
"Errors": [],
"FieldGroups": []
}
]
}
]
}