A webhook is a simple way of transferring data from a Playable campaign to any third party system.
If you cannot use one of our pre-built API integrations, you can likely use a webhook. Webhooks are also often used to add an identifier (e.g. email or userID) to a record before the data is sent to the CRM or in connection with a Zapier workflow.
The difference between this integration and our other webhook integration is that, in this one, the data is sent in batches rather than being transferred every time someone registers on your campaign. This means that all the registrations within a certain timeframe get added to a queue and are then transferred all together based on your desired time interval.
In this article, we'll explore the process of configuring the webhook batch integration in the platform. We will cover these topics:
Difference between a webhook and an API integration
Unlike an API integration, a webhook doesn't search in a database to see if the information is already there. Instead, it sends the data regularly based on your decided time interval.
This means you do not have the option to update an existing contact or to only send contacts who are new to your database.
Instead, you should have a process or flow set up on the receiving end to accept and "wash" the data as it comes in. Whether this cleanup is a manual process or is done automatically by the CRM depends on your system.
Setting up a webhook in Playable
You can add a webhook to a campaign under Integrations > Misc. > Webhook (Batch)
Configuring a webhook
Select the trigger. This decides which event in your campaign should trigger the webhook.
Add additional conditions. This can be used if you only want to transfer certain registrations based on, for example, input in the registration form or game performance.
Enter your URL endpoint. This is where the data will be sent.
Enter parameter path to specify where in the request the data should be sent. This depends on what is expected by the receiving end.
Select your request type (GET or POST). To send information, you will use the POST method.
Choose your content type: URL encoded (also called "Form") or JSON
Authentication
Webhooks deliver data to publicly accessible URLs. This means that anyone — the webhook provider, or anyone else on the internet — can send HTTP requests to your endpoint. That's why we provide authentication options in the webhook settings.
The setup you use will depend on the requirements of your system and the level of security you would like to have.
Webhooks support three authentication methods:
OAuth 2.0: A secure, token-based mechanism requiring a valid access token in the request header.
Bearer Token: A pre-shared token included in the request header for straightforward integration.
Basic Authentication: Uses a Base64-encoded username and password for simple setups.
Interval Settings
As mentioned, the difference between this integration and our other webhook-integration is that this one transfers the data in batches. Therefore, you have the option to select the interval for the batches to be transferred to your endpoint. Here you have three options: daily, hourly, or every 15 minutes. The daily and hourly options will let you define specific days of the week or hours of the day.
Type
Daily
Hourly
15 min interval
When choosing Daily, the default is that it would transfer the file every day at 1 am the next day. It is also possible to only sent on specific weekdays. The same goes for Hourly, the default is 1 am, but it can be changed if that is necessary.
Mapping data fields
Once your webhook settings are configured, you can start mapping your data fields.
Each of the fields must be manually defined, as the webhook cannot connect to your database to see what the different user attributes are called. You will need to know the name of the attribute and type it in under each field.
For example, if you have a field in your registration form called "First name" and you want to send to your endpoint where the attribute is named "first_name", you will map the field like this:
As with other integrations, you can choose to map data collected via:
The registration form fields (e.g. name and email)
The campaign (e.g. campaign name and IP address)
The game flow (e.g. winner / loser / other game result)
Static values
Static values allow you to send consistent, predefined data as part of the JSON payload, regardless of user input. These values can be mapped to fields and used for fixed parameters in your campaigns.
How to Set Up Static Values:
Scroll to Integration setup > Static information.
Add the value in the Static value field.
Example: Sending a constant source for all registrations.
Name: Source
Value: Playable
Custom Fields
Custom fields in the Webhook Batch integration allow you to store and manage additional information about contacts. These fields can be used to enrich the data you collect and customize your campaigns.
When you add a custom field in Playable, the data is transferred as part of the JSON payload. For example:
How to setup custom fields:
Scroll down to the Custom Fields section in the bottom of the integration settings.
Add a new field by specifying the
Name
andValue
.Name: Corresponds to the field group in the JSON (e.g.,
preferences
).Value: Matches the subfield within the group (e.g.,
acceptsEmail
oracceptsSms
).
Mark the field as required if applicable.
Example of how it can look:
Testing your webhook
Before going live with your campaign, we encourage you to test the integration.
To test the integration, you can play the game through the demo URL. Then, check if the data has been transferred to the Webhook under the Activity > Registration tab in our platform.
To learn more about how to test the integration, please read this Help Center article.