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.

Use cases

  • If you want to automate the delivery of claimed rewards, we can send you a message when a customer claims a reward, so the automation system on your end can begin handling the delivery right away.
  • Personalized messaging has a high impact on conversion rates. Based on a certain customer’s actions you can display personalized content to that customer, which is presumably more relevant to them.
  • Send automatic emails once specific actions are taken by a customer. A customer added a product to their wishlist? Send them a coupon discount. A customer completed a checkout? Send them a reminder that they can earn more points for reviewing the products they bought.
  • If you want to keep track of customer point balances in your customer management system for marketing purposes, we can provide the data through webhook messages.

Implementing the module

In order to support this module, you need to use the Antavo Loyalty Plugin in your Magento / Magento 2 / Woocommerce store or implement a few changes in your Custom CMS. Besides basic implementation, please follow the additional technical instructions this module in our developer documentation.