This page covers notification settings, which GBG GO also refers to as webhooks. You configure them once in Settings and reuse them across journeys, and they notify you when a journey completes. To send a message from a specific point inside a journey, add a Webhook module to the journey instead. For how to use and configure a Webhook module, see Webhook module.
Prerequisites
- Notification settings are enabled for your organisation. If the Notification settings tab is not displayed in Settings, contact your GBG representative.
- You are logged in to GBG GO with a role that has permission to read notification settings.
How notifications work
1
A user completes a journey
The journey reaches its end event in GBG GO.
2
GBG GO sends a notification
GBG GO sends a signed HTTPS POST to the endpoint configured in your notification setting.
3
Your endpoint receives the payload
The payload contains a reference to the completed journey. It contains no personal data.
4
Your application fetches the result
Your application calls Fetch journey state with the
instanceId from the payload to retrieve the completed journey.Add a notification setting
The Notification settings tab already contains two settings, Default notification (Pre-production) and Default notification (Production). These are examples that show how a notification setting is structured. They point at a placeholder endpoint that does not receive notifications, so create your own setting rather than referencing a default in a start request.
- In GBG GO, click Settings.
- Click the Notification settings tab.
- Click New setting.
The Add notification setting dialog is displayed.
- Name: A name that identifies where the notifications are sent, for example
Fraud-ops endpoint. - Endpoint URL: The public HTTPS endpoint that receives the notifications.
- Authentication: The authentication method your endpoint requires. Select either None, Basic auth, or API key.
- None: GBG GO sends no authentication credentials.
- Basic auth: Enter the Username and Password your endpoint expects.
- API key: Enter the Key, and the Header name to send it in. The header name defaults to
Authorization. You cannot usex-gbg-signatureorcontent-typeas the header name.
- Name: A name that identifies where the notifications are sent, for example
- Click Save setting.
Endpoints must be publicly reachable over HTTPS. GBG GO checks the endpoint URL when you send a test notification. Saving a setting does not check that the endpoint is reachable, so send a test notification to confirm that yours is.
Every notification is signed, whatever authentication method you select. If you select None, GBG GO still signs the request, so an endpoint that cannot put authentication in front of it can still confirm that a notification came from GBG GO. For how to check the signature, see Verify a notification.
Connect a notification setting to a journey
A notification setting does nothing until a journey references it. To connect the two, addcontext.config.notification.resource to your start request, using the resource ID and version of the setting:
JSON
resource value uses the short resourceId@version form, the same format as the journey resourceId. Use the resource ID and version shown in the list on the Notification settings tab. Do not use the full grn::: form.
Send a test notification
You can send a test notification to check that your endpoint receives and accepts notifications before you connect the setting to a journey. To send a test notification:- In GBG GO, click Settings.
- Click the Notification settings tab.
- On the row of the setting you want to test, click the three dots, then click Send test. The Test dialog is displayed, showing the request that GBG GO sends.
- Review the request body and headers.
- Click Send test request.
- Response: The body your endpoint returned. If the request did not reach your endpoint, the body explains why instead.
- Headers: The headers your endpoint returned.
- Request sent: The request GBG GO sent, so that you can compare it with what your endpoint received.
The test request uses the same shape and signature as a real completion, with test identifiers in place of real ones. The authentication header is masked in this view, and the real credential is sent only from the server.
Edit a notification setting
To edit a notification setting:- In GBG GO, click Settings.
- Click the Notification settings tab.
- On the row of the setting you want to change, click the three dots, then click Edit. The Edit notification setting dialog is displayed.
- Change the Name, Endpoint URL, or Authentication method.
- Click Save setting.
- Edit the setting and click Save setting.
- View the signing secret for the new version. For the steps, see View the signing secret.
- Configure your receiving system to accept both the previous secret and the new one.
- Update your start request to the new version.
- Once no journeys reference the previous version, stop accepting the previous secret.
Archive a notification setting
To archive a notification setting:- In GBG GO, click Settings.
- Click the Notification settings tab.
- On the row of the setting you want to archive, click the three dots, then click Archive. The Archive notification setting dialog is displayed.
- Click Archive to confirm.
Archiving a notification removes it from notification settings. It wonβt appear here and canβt be selected for new deliveries. Deliveries that already reference a pinned version keep working.
Notification payload
When a journey completes, GBG GO sends the following JSON to your endpoint:JSON
instanceId to fetch the result, and idempotencyKey to make sure you process each notification only once. The payload contains the following fields:
View the signing secret
Your receiving system uses the signing secret to verify theX-GBG-Signature header on incoming notifications.
To view the signing secret:
- In GBG GO, click Settings.
- Click the Notification settings tab.
- On the row of the setting you want to view, click the three dots, then click View signing secret. The Signing secret dialog is displayed with the secret hidden.
- Click the eye icon to reveal the secret, or click Copy to copy it to your clipboard.
Verify a notification
Every notification includes anX-GBG-Signature header. The header value is the prefix sha256= followed by the signature as a lowercase hexadecimal digest, for example:
BASH
- Compute the HMAC-SHA256 of the raw request body using your signing secret, and encode the digest as lowercase hexadecimal.
- Strip the
sha256=prefix from theX-GBG-Signatureheader to get the expected digest. - Compare your computed digest with the expected digest, using a constant-time comparison function.
- Reject the request if the digests do not match.
Delivery behaviour
GBG GO makes up to three delivery attempts, waiting five seconds between each attempt. What happens after a failed attempt depends on the response:
Because a notification can be lost, do not rely on notifications as your only way to learn that a journey completed. Call Fetch journey state as a fallback, so that you still retrieve journeys whose notification never arrived. The completed journey always remains retrievable through the API.
Delivery is at least once, so your endpoint might receive the same notification more than once. Use the
idempotencyKey to identify notifications you have already processed.
Recommended integration pattern
To get the most reliable results, design your endpoint to:- Accept HTTPS POST requests on a publicly reachable URL.
- Serve the notification directly at that URL, without a redirect. GBG GO does not follow redirects, so a proxy or an HTTP to HTTPS redirect in front of your endpoint stops the notification from arriving.
- Verify the
X-GBG-Signatureheader before processing anything. - Return
200 OKwithin 15 seconds. GBG GO waits 15 seconds for a response before it treats the attempt as failed. - Queue the work rather than processing it while GBG GO waits.
- Log the
deliveryIdso that you can trace a delivery.
- Use the
idempotencyKeyto check whether you have already processed the notification. - Call Fetch journey state with the
instanceIdto retrieve the completed journey. - Process the result.