GUIDE: Create your first Webhook in Flarie Studio
Setting up a webhook in Flarie Studio is quick and easy. Let's get cracking!
Prerequisites
Before you begin, we highly recommend that you take steps to ensure your integration is secure. You’ll authenticate your webhooks using your Flarie Studio account’s:
Access Key - used for identifying requests
Secret Key - used to validate payloads with HMAC signature
Learn more in the Authentication guide.
1. Setup
Configure the basics! Give your Webhook a Name. It will make it easier to keep of track of things! Set the Status to Active, because only Active webhooks will send requests.
Define the URL where Flarie Studio should send the webhook data. All requests are sent using the POST method. Make sure your server is ready to receive and handle JSON payloads.
- For this example we will use the very handle webhook.site to test things out! It allows us to quickly get an endpoint we can play around with to test the feature and see each request.
2. Select Trigger
Choose when the webhook should fire. Flarie supports events for both Games and Game Center. In this example we will select the Webhook type Games and the event we want to act as our trigger will be Game Start. This means that every time the game is started by a player the webhook should be triggered.
Learn more about the different options for Triggers here.
3. Select Data to Send This is where it starts to get fun! In this step you customize exactly what data should be sent in the request. You can select two options here:
Key-Value Pairs - define the key and set the appropriate Flarie Parameter as the value. Custom JSON Payload - If you are a little bit more technical you can format the JSON freely.
It’s important to note that any Flarie Parameters you define in this step as the value must also be configured in your game for the webhook to send properly.
For this example, we’ll create a game and enable Data Collection and set Email as the identifier, along with Username as an additional form parameter. This configuration will prompt a form to appear before the game starts, ensuring that the required data is collected from the player and available for the webhook to use. Make sure the Game is Active, since only Active games will trigger webhooks.
Back to the webhook! Why not provide an example for either approach? (So you can choose freely).
Key-Value Pairs
Custom JSON Payload
See what I did there? I also added one of the many other available built-in parameters (game).
Learn more about the different options for you Payload here.
4. Select what games should send webhooks
The final step in this guide is just selecting the game we created in step 3 so it will start sending data when players are coming in.
Game Play
Load the game, fill the form and play!
Results
Next we navigate to the webhook.site we configured to see the request.
Piece of cake!
Need help setting up your integration? Contact Us