API Process Token Guide

Introduction

This document will serve as a guide to creating a process token using the TrustX API. To take advantage of the TrustX API, an API key is required. Follow the API Keys Guide for more information.

Create a Token

A token grants access to the caller to invoke API calls on TrustX. Once the token is generated it can be reused, however it must be noted that the token has a 'time to live'. Once the 'time to live' has expired a new token must be generated.

POST https://{{tenant}}.{{region}}.trustx.com/api/arthr/apiKeys/issue Content-Type: application/json X-API-Key: {{apiKey}} {}

Create a Process Token

When creating a Process Token using the TrustX API, there are several parameters that can be passed through the request body. Below is a list of all available parameters and a description of their behavior.

Parameters

Parameter Name

Type


Description

Required

name

string

maxLength: 50

minLength: 0

A unique name to describe the process token.

required

description

string

maxLength: 2000

minLength: 0

A short description of the token.

optional

processDefnName

string

maxLength: 50

minLength: 0

The process definition name.

Using the combination of process definition name and process definition version a specific process definition is bound to the process token to be used when a process instance created with a token.

required

processDefnVersion

int32


The process definition version.

Using the combination of process definition name and process definition version a specific process definition is bound to the process token to be used when a process instance created with a token.

optional

uiUrl

string

maxLength: 500

minLength: 0

The URI of the application to execute the process definition when the process instance is started.

Currently only TruxtX user interfaces are supported.

optional

status

string

Enum: ACTIVE,INACTIVE

The current status of the token. Possible values include: ACTIVE, INACTIVE

required

type

string

Enum: UNLIMITED,

MULTI_USE_COUNT_LIMITED,

MULTI_USE_TIME_LIMITED

The process token type. An unlimited process token will not expire. A multi-use can have multiple uses determined either by a count or date. Alternatively, the limited process token will have a single use but expire after the defined date.

Possible values include:

UNLIMITED

MULTI_USE_COUNT_LIMITED

MULTI_USE_TIME_LIMITED

required

notBeforeDtm

date-time


The token will remain inactive before this date.

optional

notAfterDtm

date-time


The date after which the token will be inactive.

optional

maxCount

int32


The number of times the token can be used.

In the example above the token can be used once only.

optional

counter

int32


The current usage count.

optional

maxProcessDuration

object



optional

startProcessAddress

string



optional

parameters

Map<String,String>


A map of additional parameters can be supplied to provide extra information when the process instance is started.

This additional parameter map could typically contain information with the following keys:

  • firstName

  • lastName

  • email

  • phoneNumber

These are typically attributes that are useful for searching for an ID&V applicant. Any set of additional parameters may be passed in.

Using additional parameters the redirect URL can also be specified with they key _redirectUrl


Examples

Create Process Token uses the POST endpoint:/api/process-manager/processTokens.

Example: HTTP Request

POST https://{{tenant}}.{{region}}.trustx.com/api/process-manager/processTokens Content-Type: application/json Authorization: Bearer {{token}} { "name": "My Process Token", "description": "A token that allows me to start create an instance of my process definition", "status": "ACTIVE", "type": "MULTI_USE_COUNT_LIMITED", "maxCount": 1, "processDefnName": "{{processDefnName}}", "processDefnVersion": "{{processDefnVersion}}", "uiUrl": "https://{{tenant}}.{{region}}.trustx.com/web/trustweb", "parameters": { "email": "myemail@daon.com", "_redirectUrl": "https://www.daon.com" } }

Example: Multi-Use Time Limited Token

POST https://{{tenant}}.{{region}}.trustx.com/api/process-manager/processTokens Content-Type: application/json Authorization: Bearer {{token}} { "name": "testToken", "type": "MULTI_USE_TIME_LIMITED", "status": "ACTIVE", "uiUrl": "https://skyprodqc.oak.trustx.com/web/trustweb", "processDefnName": "testprocessforniall", "processDefnVersion": 6, "notAfterDtm": "2023-12-07T15:45:25.000Z", "notBeforeDtm": "2023-09-22T13:45:25.971Z", "parameters": { "firstName": "firstName", "lastName": "lastName" } }

Example: Unlimited Token

POST https://{{tenant}}.{{region}}.trustx.com/api/process-manager/processTokens Content-Type: application/json Authorization: Bearer {{token}} { "name": "unlimitedToken", "type": "UNLIMITED", "status": "ACTIVE", "uiUrl": "https://skyprodqc.oak.trustx.com/web/trustweb", "processDefnName": "testprocessforniall", "processDefnVersion": 6, "parameters": { "firstName": "firstName", "lastName": "lastName", "email": "test@daon.com", "_redirectUrl": "https://www.daon.com" } }