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:
- Navigate to TRIFFT Administration.
- Go to Settings > Webhooks.
- 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:
- Navigate to the Authorizations tab.
- Click Add new to create an authorization.
- 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
orPUBLIC
). - Basic Authentication: Enter a username and password for the third-party service.
- Header Authentication: You need to define a key-value pair along with a type (either
- 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:
- Navigate to the Webhooks tab.
- Click Add new.
- 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
, andPATCH
). - 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
, orFORM data
. - Payload: Define the data structure to be sent.
- Click Save to create the webhook.
3. Publish and Monitor the Webhook
- Navigate to the newly created webhook’s Detail page.
- 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.
- 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.
- If
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.
Updated 27 days ago