Webhook and return values
Last updated
Last updated
The brand must transmit the userid to the server where the HTML5 game files are hosted via the Webhook server. Once the game ends, the values of userid and GameResult are returned to the Webhook server. Through the userid, the brand can identify who the game player is and receive the GameResult information of the respective player via the Webhook server. The setup of such a Webhook server must be carried out by the brand itself.
You can use the userid and Webhook to send game-related data to the brand's Webhook server after the game on Brand hosting.
When a mini-game is launched on the brand’s server, the user ID (userid) is retrieved from the brand’s Webhook server via a GET request and passed to the mini-game execution URL.
The mini-game runs within the web page environment of the brand’s server.
After the game ends, the game score is displayed on the results screen.
The brand’s Webhook server receives game-related data through the Webhook.
Based on the received data, the brand operates its own leaderboard and rewards programme.
The brand must set up a Webhook program on their server to receive game result data.
You need to enter the Webhook server’s address in the Installation section of Studio.
Download the game file with the completed setup as a ZIP file.
Copy the ZIP file to the brand server and complete the necessary setup.
The brand applies the received data to their own leaderboard or reward program based on the data transmitted via Webhook.
When running the mini-game in a web browser, the ‘userid’ parameter and its value must be included using the GET method.
Parameter
userid
Unique ID generated from the brand's system
Alphanumeric (case-sensitive) + up to 20 digits
T4g4fLTaorjames
Example, Original campaign URL address https://brand.server.com/ The brand's system must call this URL and send the "userid".
https://brand.server.com/?php=userid=T4g4fLTa
After the game, the result value and various data are received by the brand’s server through the Webhook created by the brand.
userid
User's unique ID
T4g4fLTa or james
time
Datetime when the game player attempted to play
Unix Timestamp (Milliseconds)
result
Game Score obtained by the game player
3500
playtime
Duration of play by the game player (in seconds)
20
PHP example
Here is a PHP example that receives the result of a mini-game in JSON format and inserts it into a MySQL database.
SQL