Tutorial: Enabling Webhook Integration

What is a webhook?

A webhook is a system used by an application to send information to other applications in real time. In Easypromos, webhook integration enables you to send registration data from your promotion participants to your own application in real time. You can then use your application to manage and manipulate the data according to your needs.

 

NOTE: Webhook integration is only available for promotions created with the White Label version of the platform.

 

Below, we outline the benefits of webhook integration and explain how to configure this feature in your promotions.

 

What can you do with webhook integration?

The webhooks system enables you to utilize, in real time, the data of users registered in your promotions. The mostly frequently used features of webhook integration are:

  • Send the registration details which have been collected from your promotion to an application external to Easypromos. For example, you could link the promotion database to your own CRM system.
  • Gather information from a number of promotions into the same application. For example, feed a microsite with photos and entries from all your contests.

 

Before you begin

Before starting the process you should keep in mind the following:

  • Webhooks integration is an advanced feature and so a developer or someone with advanced programming knowledge will be needed to implement it.
  • You will also need a server that accepts POST calls, and a way to write a script that performs an action in response.
  • Create a test URL with Request Bin to see how you’ll receive the data.

 

How to set up webhooks

To configure webhook integration you’ll need to follow these steps:

  

1. Access the Promotion Management Page and click on ‘Integrations’:

2. Next, click on the ‘Webhooks’ image to enable integration.

3. You’ll gain access to the Webhook integration settings page. From here you’ll be able to configure the following two options:

a) Webhook URL: This is the URL you’d like the data of your promotion participants to be posted to. If you don’t have a callback URL, speak to your developer or ask an expert to set one up.

b) Webhook key (optional): You also have the option of adding a reference to the webhook via this alphanumeric text field. For example: use the promotion ID or another promotion reference as a key in order to identify it more easily. Some uses of Webhook Key are:

  • To classify and distinguish between different promotions. For example, if you have webhook integration enabled in a number of promotions which are running simultaneously, the webhook key allows you to classify them in your application and distinguish between them more easily.
  • Utilize the webhook key as a security code to verify that the call is being made by the Easypromos server.

 

What information is sent?

Our server will send all the information of participants who register in the application to the URL of the webhook following the POST request method. 

Therefore, each time a user completes your promotion’s registration form, Easypromos will send the following information to the URL configured for the webhook:

 

Parameter Description
DATA.JSON

Information registered via the registration form in JSON format. For example:

{"User":{"id":"618148992","name":"Edgard Massot Casademont","first_name":"Edgard","last_name":"Massot Casademont","fbuid":"1425878509","created":"2016-07-20 17:26:31","public_entry":"0","device":"","date":"Jul.20.2016 17:26"},"Recruiter":[]}

 

KEY

This is the name or reference that you’ve configured via the 'Webhook key' field in the webhook integration section of the Easypromos application. 

 

Can I carry out a test to preview how I’ll receive the information?

Yes. You can test the behavior of your webhook before launching your promotion and receiving real registration data from participants. To do this, create a test URL with RequestBin. This will provide you with a preview, enabling you to see the format in which you’ll receive the information. 

To do to this, follow these steps:

 

1. Access RequestBin and create a new Request:

2. Access the Integrations > Webhooks section of the application. In the field 'Webhook URL' enter the URL that’s just been generated on the RequestBin page. You also have the option of adding a 'Webhook Key' and then, after saving the changes, clicking on the 'Test' button:

3. In the RequestBin URL you’ll be able to refresh the page in order to see the format of the data that will be sent:

4. If you’d like to see the format of the real data that will be sent, activate the promotion and carry out a real test by participating as a user. Coming back to this page you’ll see that the data.json parameter now includes real data:

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.