1. Home
  2. Notifications
  3. Using Webhooks

Using Webhooks

Introduction

With Antavo’s Webhook module, you can set up automated processes, spanning between your system and the Loyalty Program. When specific actions are taken by your customers in the loyalty program, Antavo sends webhook messages, which you can use to create automated mechanisms in your system. All your development team needs to do is create a webhook endpoint and process the webhook message we send.

Setting up the module

You can find the Webhook module’s configuration page by clicking on the ‘Modules’ item in the sidebar, and scrolling down to the ‘Core’ module category. The page will open up on the ‘Settings’ tab of the page where you can define webhook settings.

Basic settings

  • URL: You can paste the webhook endpoint your developers set up.
  • Timeout: You can set a timeout value for the webhook request (optional). If you leave it blank, the default value will be applied, which is 1 second. Make sure you define the timeout value in seconds.
  • Content type: The data can be sent in either URL-encoded or in JSON format, whichever is more comfortable for your developer.
  • Actions: Here you can set the list of events that will trigger webhook messages. Please divide events with commas (i.e. checkout,profile,social_connect, etc.).

Authentication

To ensure the security of server-to-server communications and help you make sure that the webhook data originates from Antavo, we have introduced the webhook authentication header. By default, the authentication is set to ‘None’ which means that the header will not be added to webhook messages. To enable authentication, select one of the following three authentication methods from the dropdown list, which defines the content and format of the header:

  • Basic
    Adds a webhook header of basic auth fields in a Base64 encoded format.

    • Username
    • Password
  • AWS
    Adds a full AWS Signature

    • Region
    • Service
    • Access Key ID
    • Access Key Secret
    • Algorithm prefix
    • Vendor key
  • AWS-S3
    Adds a full AWS Signature compatible with Amazon Web Services S3 Bucket communcations

    • Region
    • Service
    • Access Key ID
    • Access Key Secret
    • Filename format

Be sure to hit the ‘Save’ button before leaving the page.

Testing the webhook

Test the webhook mechanism you’ve set up with the ‘Test’ button, which you can find at the upper right side of the ‘Settings’ tab. This will allow you to make sure that the format is correct and the request is returned without errors.

Webhook log

To help you keep track of all the webhook messages Antavo sends, we have introduced the Webhook log page, which you can find by navigating to the ‘Log’ tab of the module configuration page.

Here you can see all the webhook messages we have sent with the following details:

  • Date
  • Action
  • Customer
  • Response code
  • Status

You can filter the webhook messages based on their status code by using the Filter button on the upper right hand side of the page.

To check the exact request and response, click on the View button next to the relevant webhook message.

In the case that you encounter an error on your webhook endpoint, it’s possible to resend webhook events to cover up the outage. Open the webhook message you want to resend and then click ‘Resend’ on the upper right-hand corner of the page.