Overview 

This quick start guides you through the following: 

  • Set up authentication. 
  • Execute your first customer journey. 

This guide is intended for developers who need to integrate customer verification workflows into their applications. 

Before you start 

Before running this quickstart, complete the following prerequisites: 

  • Your GBG account manager has provided your API credentials. This includes your client ID, client secret, API username and password. 
  • A business user must have created and published a customer journey to Preview or Production. 
  • You have the published journey’s resource ID and version. This is found in the journey dashboard. 
  • Your password has been reset from the temporary one (required before API authentication). Ask your account manager for help with password reset. 
  • You have a development environment capable of making HTTP requests, for example, Postman. 

Step 1: Request an access token for authentication 

Make a POST request to obtain your Bearer token: 

cURL
curl --request POST \
 --url https://api.auth.gbgplc.com/as/token.oauth2 \
 --header 'accept: application/json' \
 --header 'content-type: application/x-www-form-urlencoded' \
 --data 'client_id=your-client-id&client_secret=your-client-secret&username=your-username&password=your-password&grant_type=password'

You receive an access token that you’ll use for all subsequent API calls, like this: 

JSON
{ 
  "access_token": "your-access-token", 
  "token_type": "Bearer",  
  "expires_in": 3600 
}

Store the access_token value securely. Do not share them in emails, chat messages, client-side code or publicly accessible sites.

If you run into a credentials error when making a token cURL request, it’s most likely your credentials aren’t correct. Contact your account manager for the correct or updated credentials. 

Step 2: Execute your first customer journey 

There are two ways to execute your first journey:

Execute journey in non-prefill mode 

Use your provided access token, journey resource ID and version to start a journey. Make a cURL POST request to the (/journey/start) endpoint like this: 

cURL
curl --request POST \
 --url https://eu.platform.go.gbgplc.com/captain/api/journey/start \
 --header 'Authorization: Bearer your_access_token' \
 --header 'Content-Type: application/json' \
 --data '{
   "resourceId": "your-journey-resourceID@latest",
   "context": {
      "subject": {
      },
      "documents": [],
      "biometrics": []
    }
  }'

You receive an instanceId that represents your active journey. The instance ID looks like this:

JSON
{
    "instanceId": "QxLNUpNEPiFR9LurKp8BmJn3"
}

Get the journey resource ID and version from your GBG GO dashboard or business designer after a journey is published.

Replace @latest with your specific journey version. For example: "resourceId": "8c24f3a5b76d09e182c397fd45c91ae3f8b530d7a19e64c2bd93f5a76c48e09f@3x5wz848".

You should note that using @latest can have up to 10 minutes delay in processing.

Execute journey in pre-fill mode (optional) 

If you have customer data available, include it in the context object:

cURL
curl --request POST \
  --url https://eu.platform.go.gbgplc.com/captain/api/journey/start \
  --header 'Authorization: Bearer your_access_token' \
  --header 'Content-Type: application/json' \
  --data '{
    "resourceId": "your-journey-resourceID@latest",
    "context": {
      "subject": {
        "identity": {
          "firstName": "Jane",
          "lastNames": ["Doe"],
          "dateOfBirth": "1992-10-01",
          "emails": [
            {
              "type": "work",
              "email": "jane.doe@example.com"
            }
          ]
        }
      },
      "documents": [],
      "biometrics": []
    }
  }'

You receive an instanceId that represents your active journey. The instance ID looks like this:

JSON
{
    "instanceId": "QxLNUpNEPiFR9LurKp8BmJn3"
}

Context user data is obtained from the user schema generated after a journey is published.

Execute journey in async pre-fill mode (optional)

To start a journey in asynchronous mode, include "async": true in the config object within your request context, as shown below:

cURL
curl --request POST \
  --url https://eu.platform.go.gbgplc.com/captain/api/journey/start \
  --header 'Authorization: Bearer your_access_token' \
  --header 'Content-Type: application/json' \
  --data '{
    "resourceId": "your-journey-resourceID@latest",
    "context": {
     "config": { "async": true},
      "subject": {
        "identity": {
          "firstName": "Jane",
          "lastNames": ["Doe"],
          "dateOfBirth": "1992-10-01",
          "emails": [
            {
              "type": "work",
              "email": "jane.doe@example.com"
            }
          ]
        }
      },
      "documents": [],
      "biometrics": []
    }
  }'

Next steps

Now that you’ve completed this quickstart, check out the following guides to learn more about integrating GBG GO API: