UserID & Webhook
Last updated
Last updated
The studio provides branded mini-games (HTML5 games) and stores game results (scores, playtime) in the system database.
However, some brands want to retrieve game results and store them in the brand's database.
This guide explains how brands can obtain game results from the studio.
The game player is connected to the customer (brand)'s system (website or app, etc.).
The brand's system recognizes the player and assigns a unique ID ('userid') to the player.
The brand's system loads the branded mini-game by calling the system's URL with the 'userid'.
The player plays the branded mini-game.
When the player completes the play, our (studio) system sends the game results to the brand's system using the Webhook URL.
The customer needs to create a campaign on our system's Studio website.
The brand needs to create a program (webhook) on their server to obtain game results.
The brand needs to update the webhook URL in the "Return Game Result" section of the campaign settings.
In the basic scenario step 3, the brand's system needs to call our (studio) system's URL with the 'userid'.
The 'userid' value must be passed using the GET method.
userid *
Unique ID generated from the customer's system
Alphanumeric (case-sensitive) + up to 20 digits
T4g4fLTaorjames
Example, Original campaign URL address https://branded.mini-games.io/?php=landing@8NKHT2hK&campaign_no=1 The brand's system must call this URL and send the "userid".
https://branded.mini-games.io/?php=landing@8NKHT2hK&campaign_no=1&userid=T4g4fLTa
In step 5 of the basic scenario, the brand needs to create a program (webhook) on their server.
This webhook must have a URL that can be accessed from the system server.
Our (studio) system sends game results using the POST method with the following parameters.
If the branded mini-game is not an 'instant win' type.
userid *
User's unique ID
T4g4fLTa or james
tx_id *
Unique ID for each game played
234234
time *
Datetime when the game player attempted to play
2023-04-10 06:39:23
score *
Score obtained by the game player
3500
playtime*
Duration of play by the game player (in seconds)
20
* Indicates a required value.
If the branded mini-game is an 'instant win' type.
userid *
User's unique ID
T4g4fLTa or james
tx_id *
Unique ID for each game played
234234
time *
Datetime when the game player attempted to play
2023-04-10 06:39:23
reward_image *
Reward image
https://branded.mini-games.io/upload/reward/f1GByiOHZZ9biLGd32jp.png
reward_item *
Return code (Return Code)
Coffee
* Indicates a required value.
The brand server must return the result code to our studio system.
S
When successful
F
When failing If you want to state the reason for failure, you can add text after the "F" code. Example) "F: Score is missing."
To obtain parameter values when the returned data is in JSON format, you must first parse the data.