Webhook
Flarie Studio is equipped with a powerful Data Integration - Webhook feature that empowers you to seamlessly respond to events and design personalised processes. Whether it’s reward users in your own platform, tracking user activity and engagement, or consolidating your analytics - this feature streamlines the process.
In order to get going with Data Integration you simply create a Webhook in your Flarie Studio account, provide a Webhook URL where Flarie will POST the data. Choose your events that you would like to monitor and determine the specific Games, Game Centers or Rewards where these events should trigger.
You may find payload examples for each Webhook Event in your Flarie Studio account.
Authentication (optional)
Enable Access Key and Secret Key in Flarie Studio to get authentication sent in the header of the webhook request.
Learn more about Access Key here
Learn more about Secret Key here
-
If Access Key is enabled, the Authorization header will be added to the request:
Authorization: Bearer {accessKey} -
If Secret Key is enabled, the X-Signature header will be added to the request:
X-Signature: SHA-256 HMAC signature generated using the Secret Key and the JSON payload
The X-Signature header contains the SHA-256 HMAC (Hash-based Message Authentication Code) signature generated by using the Secret Key to hash the JSON payload. This signature is used for verifying the integrity and authenticity of the webhook payload.
Below is an example of how you can verify the payload with the X-Signature
const crypto = require("node:crypto");
const payload = // your json payload in the request
const payloadString = JSON.stringify(payload);
const secretKey = "your-secret-key";
const calculatedSignature = crypto
.createHmac("sha256", secretKey)
.update(payloadString)
.digest("hex");
const X_Signature = "X-Signature-in-the-header";
if (X_Signature === calculatedSignature) {
console.log("Payload is authentic and unmodified")
} else {
console.log("Payload is modified")
}
Game - Events
-
First Game Start
Description:Event sent the first time the Player starts the Game.Payload: Event, User Base, Game
-
Form Submission - StartGame
Description: Event sent time the form is submitted when the Player starts the Game. This event will be sent at the start of every Game Session.Payload: Event, User Base, Game
-
Game Start
Description: Event sent every time the Player starts the Game.Payload: Event, User Base, Game
-
Challenge Completed
Description: Event sent when the Player completes the challenge by reaching the set target in your Game, This event will only be sent once per Game Period.Payload: Event, User Base, Game, Game Score
-
Form Submission - Challenge Completed
Description: Event sent when the Player submits the form after a Challenge has been completed. This event can be sent multiple times, since the Player can access the form and modify the details.Payload: Event, User Base, Game, Game Score
-
Game over
Description: Event sent every time the Player completes a Game Round and submits a Game Score.Payload: Event, User Base, Game, Game Score
-
Winners - Prizes
Description: Event sent with the generated winners (array) when a Game or Game Period expires.Payload: Event, [Prizes]
Game - Events
-
Game Center SignUp
Description:Event sent when the Player successfully registers in your Game Center.Payload: Event, User Base, Game Center
-
Game Center Additional Form Submission
Description:Event sent when the Player submits the form of additional parameters in your Game Center. This event will happen if you add parameters to your Game Center and the Player is already registered.Payload: Event, User Base, Game Center
-
Game Center Rewards
Description: Event sent when the Player purchase a Reward in the Game Center.Payload: Event, User Base, Game Center, Game Center Reward