Process Instances in Redirect URL
Information about a Process Instance can be extracted from the redirect URL by using variable substitution. This guide will demonstrate the steps to send Process Instance information from the redirect url in the Backoffice.
This can be useful for users who would like to send information such as the Process Definition ID, version, and name, and Process Instance ID to redirect the user to a specific page based on their individual ID&V flow.
Configuring the Redirect URL
The redirect url allows users to configure the URL which the session will redirect to once the flow has been completed. This configuration can be updated by taking advantage of the Custom Parameters of a Process Definition Token. For more information, see Process Definition Tokens Guide.
When creating or editing the Process Token, click the green 'Add New Custom Parameter' button. A new key-value pair will appear below the list of additional parameters.

The key value must be set to _redirectUrl.

When defining the 'value' parameter, the following variables can be passed from the URL:
{PROCESS_DNF_TYPE}
{PROCESS_DNF_NAME}
{PROCESS_DNF_VERSION}
{PROCESS_DNF_ID}
{PROCESS_INSTANCE_ID}
Variables can included as part of the URL using the following format:
pdt=%7BPROCESS_DNF_TYPE%7D // Process Defintion Type
pdn=%7BPROCESS_DNF_NAME%7D // Process Definition Name
pdv=%7BPROCESS_DNF_VERSION%7D // Process Definition Version
pdid=%7BPROCESS_DNF_ID%7D // Process Definition ID
pid=%7BPROCESS_INSTANCE_ID%7D // Process Instance ID
For example: http://www.somedomain.com?pid=%7BPROCESS_INSTANCE_ID%7D&pdid=%7BPROCESS_DNF_ID%7D&pdv=%7BPROCESS_DNF_VERSION%7D&pdn=%7BPROCESS_DNF_NAME%7D&pdt=%7BPROCESS_DNF_TYPE%7D
This can be entered in the Backoffice as follows:

Complete the creation of the Process Token by clicking the 'Create Token' button.
Example using TrustX API:
The example below demonstrates creating the same Process Token using the TrustX API.
POST https://{{tenantid}}.oak.trustx-dev.com/api/process-manager/processTokens
Content-Type: application/json
Authorization: Bearer {{token}}
{
"name": "Example",
"description": "my token description",
"status": "ACTIVE",
"type": "UNLIMITED",
"processDefnName": "{{processDefinitionName}}",
"processDefnVersion": "{{processDefinitionVersion}}",
"uiUrl": "https://www.google.com",
"parameters": {
"lastName": "Doe",
"email": "johndoe@somedomain.com",
"phoneNumber": "+123...",
"referenceID": "asdasd",
"_redirectUrl": "http://www.somedomain.com?pid=%7BPROCESS_INSTANCE_ID%7D&pdid=%7BPROCESS_DNF_ID%7D&pdv=%7BPROCESS_DNF_VERSION%7D&pdn=%7BPROCESS_DNF_NAME%7D&pdt=%7BPROCESS_DNF_TYPE%7D"
}
}
Conclusion
Once a Process Instance has been successfully completed, the user will be redirected to the URL provided as the redirect URL. Using variable substitution, each variable included in the URL will be substituted accordingly.
For example:
The example below demonstrates an API response once a Process Instance has been completed. Note the "redirectUrl" value.
{
"code": 200,
"message": "Successful processing.",
"status": "SUCCESSFUL_PROCESSING",
"tenantId": "exampleTenant",
"businessKey": "6BOMNFPP2SMPCG2DPFJEGTCY7U",
"stepId": "thank-you",
"screenId": "thank-you",
"screens": [
"thank-you"
],
"variables": {
"activityConfig": {
"activities": null
}
},
"redirectUrl": "http://www.somedomain.com?pid=6BOMNFPP2SMPCG2DPFJEGTCY7U&pdid=YDHESUTLPMTF777CHSB2OBLZFY&pdv=15&pdn=accfmetrics&pdt=VERIFICATION",
"themeUrl": null,
"currentLanguage": null,
"defaultLanguage": "es",
"supportedLanguages": [],
"localizationConfigUrl": "https://cdn.oak.trustx.com/",
"timeoutInSeconds": null,
"timeoutRedirectUrl": null
}