Workflow Studio (API)
Workflow Studio is a platform used to create fast and compliant onboarding flows. Via our new API, you get countless possibilities to take advantage of our flow builder and access our catalogue of services.
In order to use Workflow Studio with Document Verification, we highly recommend you integrate with one of our easy-to-use SDKs. We offer SDKs for Web, Android and iOS, so pick the one that best suits your needs.
1. Initialize Workflow
Calling GET to api.trulioo.com/wfs/interpreter-v2/flow/{flowId} will allow you to retrieve details about your Workflow, such as which fields you should collect from your users.
You can get the flowId
required to call this endpoint from your Implementation Specialist, or by accessing your Workflow in Workflow Studio, and getting the flowId
from the address bar.
The initialize call will give you the following response:
{
...
"elements": [
{
"id": "someUniqueId",
"name": "FullName",
"type": "text",
"validations": [ ... ]
}
],
...
}
Each field, such as FullName in this example, will be given a unique identifier. This identifier can then be used to submit your users' data when you make a POST call in Step 2.
This call also returns an x-hf-session
in the header response, which you can use in Step 3.
2. Submit Fields
Each field from Step 1, such as FullName in this running example, will be given a unique identifier, which is used to submit your users' data when you make a POST call to https://api.trulioo.com/wfs/interpreter-v2/submit/{flowId}:
{
"someUniqueId": "usersFullName"
}
The POST call will result in the following response:
{
"canGoBack": boolean,
"id": "string",
"shortCode": "string",
"type": "trulioo_doc_v"
}
The shortCode
is needed to launch the DocV SDK.
3. (Optional) Web Page Redirect
By providing the x-hf-session
in your API call, you can resume a Workflow session. This means that you can bring a user to a different webpage, and then allow them to continue their flow. This is done by making a very similar GET call to the one in Step 1: https://launch-workflow.trulioo.com/{flowId}?x-hf-session={x-hf-session}.
4. Get User Data From Workflow Studio API
Authenticate
Authentication requires a Client ID and Client Secret, which will be given to you by your Implementation Specialist.
Note: These are not the same as the Client ID and Secret from the API Export Step of your workflow.
After calling http://auth-api.trulioo.com/connect/token, you should receive an authorization token in the Token
field, which you will need in the query call below.
Query User Data
A GET call to https://api.trulioo.com/wfs/export/v2/query/client/{x-hf-session} will return the following:
{
"id": "string", // corresponds to x-hf-session
...,
"flowData": {
"...": {
"id": "...",
"completed": boolean,
"fieldData": { ... },
"fileData": {},
"serviceData": [
...,
{
...,
"transactionInfo": {
"transactionId": "string"
}
}
]
}
}
}
The transactionId
can then be used to look up further information about the transaction through all of the calls in Step 5 below.
5. Get User Data From DocV API
Authorize DocV API
Connect to the /authorize endpoint by passing in a license in the authorization header of your HTTP request. You will receive an access and refresh token in the form of strings as the API's response. This new access token will be needed for the following API calls.
Note: This is different from the
accessToken
retrieved from Step 4.
Get Transaction Details
Retrieve the data of a transaction with the /customer/transactions/{transactionId} endpoint. You will need to pass in the transaction ID from Step 4 as a path parameter. The API will return the transaction corresponding with the ID inputted in a JSON format. See a sample response here.
Get Transaction Images
Retrieve an image from a transaction with the /customer/transactions/{transactionId}/images/{imageId} endpoint. You will need to pass in the transaction ID of the transaction from Step 4, and an image ID of an image from the transaction details call. The API will return the image requested in Base64 Format. See a sample response here.