Webhooks

Webhooks in TRIFFT allow you to forward events from the TRIFFT Loyalty Platform to third-party services in real-time. These events typically relate to member activities but can also include other platform-related triggers. Webhooks are a powerful way to integrate TRIFFT with external applications, enabling automation and synchronization between systems. For a general explanation of how webhooks work, refer to this Wikipedia article.

Accessing Webhooks

To manage webhooks in TRIFFT:

  1. Navigate to TRIFFT Administration.
  2. Go to Settings > Webhooks.
  3. You will see the main webhooks interface with two tabs:
    • Webhooks: Displays a list of configured webhooks.
    • Authorizations: Manages credentials required for third-party integrations.

Setting Up Webhooks

To successfully create a webhook, follow these steps:

1. Create an Authorization

Before adding a webhook, you need to authorize the third-party service:

  1. Navigate to the Authorizations tab.
  2. Click Add new to create an authorization.
  3. Fill in the required fields:
    • Endpoint: The URL where webhook events will be sent.
    • Type:
      • Header Authentication: You need to define a key-value pair along with a type (either SECRET or PUBLIC).
      • Basic Authentication: Enter a username and password for the third-party service.
  4. Click Save to finalize the authorization. The authorization will now be available for use in webhook configurations.

2. Create a Webhook

Once an authorization exists, you can configure webhooks:

  1. Navigate to the Webhooks tab.
  2. Click Add new.
  3. Fill in the webhook details:
    • Name: Internal name for identifying the webhook.
    • Description: Optional internal description.
    • Event: Select the event type from the dropdown (typically user-related events).
    • Enable Authorization: Toggle this on if the webhook requires authorization.
    • Authorization: Select an existing authorization from the dropdown.
    • Endpoint URL: The destination URL where webhook data will be sent.
    • Endpoint Type: Choose the HTTP method (supported types: POST, PUT, DELETE, GET, and PATCH).
    • Log Only Errors: If enabled, only failed webhook calls will be logged. If disabled, all events (including successful ones) will be logged.
    • Custom Headers: Optionally, add custom headers.
    • Payload Type: Choose from JSON, XML, PLAIN, or FORM data.
    • Payload: Define the data structure to be sent.
  4. Click Save to create the webhook.

3. Publish and Monitor the Webhook

  1. Navigate to the newly created webhook’s Detail page.
  2. Click Publish to activate the webhook. Webhooks remain inactive until published.
    • You can Unpublish a webhook if you need to disable it temporarily.
    • Options to Edit, Duplicate, or Delete are also available for easy management.
  3. Switch to the Logs tab to monitor the webhook’s execution:
    • If Log Only Errors is enabled, only failed webhook calls will be recorded.
    • If disabled, both successful and unsuccessful webhook calls are logged.
    • It’s recommended to log all events when setting up a new webhook for debugging purposes.

Managing Webhooks

  • You can filter, edit, or delete existing webhooks from the Webhooks tab.
  • Authorizations can be updated in the Authorizations tab.
  • Ensure that the third-party system correctly processes webhook events to prevent failed requests.

For further assistance, contact TRIFFT support or refer to the TRIFFT API Documentation.