Branded Mini-Games Support
  • Welcome
  • Branded Mini-Games
    • Create a campaign
      • Method 1
      • Method 2
      • Campaign Types
        • Website
        • Mobile App
        • Playable ads
        • Brand Hosting
    • Game Settings
      • Game Customization: Easy Mode
      • Game Customization: Pro Mode
        • Other Features
      • How to Modify Graphics
      • Configurations
        • Minimum Game Score Setting
        • Using Hearts (Game Life)
      • Activating the prepared game
      • Instant Win
    • Campaign Settings
      • Campaign Profiles and SEO
      • Campaign URL
      • CNAME
      • How to Add a Game to Your Website
      • Deleting Games
    • Page Settings
      • Landing Page
      • Login
      • Results and Calls to Action
        • Leaderboard
        • No Leaderboard
        • Sharing
        • Call-to-Action
      • Changing Background Music and Favicon
      • Coupon
      • Skin Editor
    • Website
      • Website -> Leaderboard
      • Website -> UserID & Leaderboard
      • Website -> Participate & Win
      • Website -> UserID & Webhook
    • Mobile App Settings
      • Android App
      • iPhone iOS App
      • Mobile App -> Leaderboard
      • Mobile App -> UserID & Leaderboard
      • Mobile App -> UserID and Webhook
      • Close button
    • Play & Redeem
      • Select a Service Group
      • Choosing a Login Method & Service Start URL
      • Exchange game points to Shopping credits
      • Exchange game points to Coupons
      • Daily Missions settings for the game
    • UserID & Webhook
      • Website
      • Mobile App
      • Brand Hosting
    • Playable Ads
      • Customer acquisition through events
      • App installation
    • Data & Export
      • Participation
      • Sign up
      • Coupon Management
    • Google Analytics
    • Paid Plan & Publish
      • Publish
      • Subscribing to a Paid Plan
      • Purchase additional CPP
      • Invoice
      • Change credit card, update billing information, cancel service
    • Brand Hosting
      • Add game
      • Server setting test
      • Webhook and return values
  • Run actual Branded Mini-Games.
  • Terms of Use
    • Terms of Use
    • Privacy policy
    • Cookie Policy
    • Data Processor Agreement
    • GDPR
      • Understanding GDPR: Overview of Data Protection Regulation
      • Personal Data and Compliance: Key Considerations
      • GDPR Compliance in Studio Operations: User Sign-Up and Privacy Policies
      • Data Management: Retention, Analytics, and Reporting
    • Coupon Town - Terms and Conditions
  • Game Development Request
  • Deutsche / German
    • Marken-Mini-Spiele
  • Français / French
    • Mini-jeux de Marque
  • Italiano / Italian
    • Mini-Giochi Brandizzati
  • Español / Spanish
    • Mini-Juegos de Marca
  • Português / Portuguese
    • Mini-Jogos de Marca
  • Türkçe / Turkish
    • Markalı Mini Oyunlar
  • हिन्दी / Hindi
    • ब्रांडेड मिनी गेम्स
  • 한국어 / Korean
    • 브랜드 미니 게임
  • 日本語 / Japanese
    • ブランドミニゲーム
  • 简体中文 / Chinese
    • 品牌小游戏
  • Arabic (العربية)
    • ألعاب صغيرة ذات علامة تجارية
Powered by GitBook
On this page
  • 1. Introduction
  • 2. Overview
  • 3. Implementation
  1. Branded Mini-Games

UserID & Webhook

PreviousDaily Missions settings for the gameNextWebsite

Last updated 8 months ago

1. Introduction

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.

2. Overview

Basic scenario

  1. The game player is connected to the customer (brand)'s system (website or app, etc.).

  2. The brand's system recognizes the player and assigns a unique ID ('userid') to the player.

  3. The brand's system loads the branded mini-game by calling the system's URL with the 'userid'.

  4. The player plays the branded mini-game.

  5. When the player completes the play, our (studio) system sends the game results to the brand's system using the Webhook URL.

Setup process

  1. The customer needs to create a campaign on our system's Studio website.

  2. The brand needs to create a program (webhook) on their server to obtain game results.

  3. The brand needs to update the webhook URL in the "Return Game Result" section of the campaign settings.

3. Implementation

Load branded mini-game with userid

  • 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.

Parameters

Name
Description
Format
Sample

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

Create a webhook to obtain game results

  • 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.

Parameter 1

If the branded mini-game is not an 'instant win' type.

Name
Description
Sample

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.

Parameter 2

If the branded mini-game is an 'instant win' type.

Name
Description
Sample

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.

Return Code

The brand server must return the result code to our studio system.

Code value
Description

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."

PHP example

// getting data
isset($_POST[‘userid’]) ? $userid = $_POST[‘userid’] : $userid = ”;
isset($_POST[‘tx_id’]) ? $tx_id = $_POST[‘tx_id’] : $tx_id = ”;
isset($_POST[‘score’]) ? $score = $_POST[‘score’] : $score = ”;
isset($_POST[‘playtime’]) ? $playtime = $_POST[‘playtime’] : $playtime = ”;
isset($_POST[‘time’]) ? $time = $_POST[‘time’] : $time = ”;
// checking validity
if (trim($score) == “”) {
    echo “F : score is missed”;
    exit;
}
if (trim($playtime) == “”) {
    echo “F : playtime is missed”;
    exit;
}
if (trim($time) == “”) {
    echo “F : time is missed”;
    exit;
}
// saving data into database
$sql  = “insert into playing_log (‘tx_id’, ‘userid’, ‘time’, ‘score’, ‘playtime’) values (‘”.$tx_id.”‘, ‘”.$userid.”‘, ‘”.$time.”‘, ‘”.$score.”‘, ‘”.$playtime.”‘);”;
//echo $sql;
// connection DB
// insert data
~~~
// result of saving
if ($result) {
    echo “S”;
}
else {
    echo “F : DB failure”;
}

To obtain parameter values when the returned data is in JSON format, you must first parse the data.