The Rigor Optimization product can post a notification of up to 10 distinct URLs when a performance snapshot has completed processing. Snapshot complete webhook notifications can be configured both at the account level and per-snapshot.
Account Level Webhooks
Webhooks enabled at the account level will fire uniformly for all snapshots created in the account by any user. To enable, you must be have Client Administrator access to your account.
To configure:
- Visit the Settings page, then select Account Settings.
- On the top-right corner, you will see a section titled Account Configuration. Click the Edit button.
- Inside the edit page, click Add URL to add a new webhook notification. You can add up to 10 distinct URLs to receive notifications.
- You can also optionally specify a Custom Key value to be returned in the payload of every webhook notification (See the Get Snapshot Detail API for the format of the postback payload). (Note: if you can also override this value on a per-snapshot basis to reconcile with your internal systems using the API, see the Per-Snapshot Webhooks section below).
- Finally, you can add any number of HTTP headers to be included in the response payload, including any authorization tokens you may require for secure access.
Per-Snapshot Webhooks
If you require a finder degree of control over when and how your webhook notifications are sent, per-snapshot webhooks are the way to go. To utilize, you will need to use the Create New Snapshot API call to initiate a new snapshot.
Inside the POST payload to the Create New Snapshot call, you can add an optional webhook element as shown below.
{
"webhook": {
"urls": [
"url1",
"url2",
...
],
"custom_key": "snapshot_custom_key",
"headers": {
"header1": "value1",
"header1": "value2",
...
}
}
}
All fields are optional and can be omitted, although you will need to supply at least one valid URL to activate the webhook.
Per-snapshot webhooks will override and replace any account level webhooks for just that one snapshot. Additionally, you can use per-snapshot webhooks without configuring account level webhooks.
Per-snapshot webhooks are especially useful if you want to reconcile a unique identifier in your internal system to a specific snapshot in the Rigor Optimization product. Additionally, per-snapshot webhooks allow you to enforce a stronger degree of security by supplying time expired authentication tokens in your postback payloads.
Webhook Payload
For both types of webhooks, a POST notification will be sent to the URL(s) specified in the webhook configuration when the snapshot completes (success or failure). The body posted will be in JSON format according to the specification described in the Get Snapshot Detail API call.
The custom_key property returned in that payload will be set to the Custom Key value specified according to your webhook configuration, or null if no value was set.