API Documentation

Complete integration guide for igamingapis gaming platform. Launch games, handle callbacks, and manage game assets seamlessly.

Launch Game API

Start a game session with encrypted user data. When a player clicks "Play" on your website, this API securely launches the game from the provider.

Request Parameters

Parameter Meaning Example
user_id The unique ID of the player 101
balance The player's wallet balance 500
game_uid A unique ID for this game session 784512
token Your API token (provided by igamingapi) 3dfu98r2q3x
timestamp Current time (in milliseconds) 1696329392000
return URL where user returns after playing https://playzone.com/return
callback URL where game sends result https://playzone.com/callback.php

Data Encryption Process

1

Prepare Data Payload

Create an array with all required parameters as shown above.

$payload = [
    "user_id" => "101",
    "balance" => 500,
    "game_uid" => "784512",
    "token" => "3dfu98r2q3x",
    "timestamp" => 1696329392000,
    "return" => "https://playzone.com/return",
    "callback" => "https://playzone.com/callback.php"
];
2

Encrypt with AES-256-ECB

Convert the array to JSON and encrypt using your 32-character secret key with AES-256-ECB encryption.

function encryptPayload($data, $key) {
    // Ensure key is exactly 32 bytes
    if (strlen($key) !== 32) {
        throw new Exception("Key must be 32 bytes long");
    }
    
    // Convert to JSON
    $json = json_encode($data, JSON_UNESCAPED_UNICODE);
    
    // AES-256-ECB Encryption
    $encrypted = openssl_encrypt($json, 'AES-256-ECB', $key, OPENSSL_RAW_DATA);
    
    // Base64 encode for safe transmission
    return base64_encode($encrypted);
}

$encryptedData = encryptPayload($payload, $secretKey);
3

Send Encrypted Request

Send the encrypted data as URL parameters to the API endpoint.

$url = "https://api.igamingapi.online/client/";
$params = http_build_query([
    'payload' => $encryptedData,
    'token' => $token
]);

$finalUrl = $url . '?' . $params;
// Redirect user to $finalUrl or use cURL to get game URL

API Endpoint

GET https://api.igamingapi.online/client/

Send encrypted payload and token as GET parameters to receive the game launch URL.

Receive Game Callback

After a player finishes a game, the game provider automatically sends a callback to your server with the game results.

Callback Data Format

{
    "game_uid": "3978",
    "game_round": "12928475122950747877",
    "member_account": "23213",
    "bet_amount": 1,
    "win_amount": 0,
    "timestamp": "2025-10-14 16:41:45"
}

Handle Game Callback

Update user balance and save transaction when receiving game callbacks.

PHP Implementation

<?php
header('Content-Type: application/json; charset=utf-8');
date_default_timezone_set('Asia/Kolkata');

$data = json_decode(file_get_contents('php://input'), true);

if (!$data) {
    exit(json_encode([
        'credit_amount' => -1,
        'error' => 'Invalid JSON 无效JSON'
    ]));
}

$game_uid       = $data['game_uid'] ?? '';
$game_round     = $data['game_round'] ?? '';
$member_account = $data['member_account'] ?? '';
$bet_amount     = (float)($data['bet_amount'] ?? 0);
$win_amount     = (float)($data['win_amount'] ?? 0);
$round_time     = $data['timestamp'] ?? '';

$credit = max(0, $bet_amount - $win_amount); // Credit = bet - win, minimum 0

echo json_encode([
    'credit_amount' => $credit,
    'timestamp' => round(microtime(true) * 1000)
]);
?>

Games Images & Assets

Fetch and download game images and assets using the API for your website or game dashboard.

GET https://softapi.gt.tc/brands.php

Get all game providers (brands) with their unique brand IDs.

Response Example

[
  {
    "brand_id": 45,
    "brand_title": "JILI"
  },
  {
    "brand_id": 52,
    "brand_title": "PG Soft"
  }
]
GET https://softapi.gt.tc/?brand_id=BRAND_ID

Fetch games under a specific brand with names, images, and assets.

Example URL

https://softapi.gt.tc/?brand_id=45

Code Examples

Launch Game - PHP Implementation

<?php
// === Example: Launch Game via SoftAPI ===

// Step 1: Set your API credentials (from your SoftAPI account)
$TOKEN  = "3dfu98r2q3x";  // Your unique API token
$SECRET = "12345678901234567890123456789012"; // 32-character secret key

// Step 2: Game details & player info
$SERVER_URL   = "https://api.igamingapi.online/client/"; // API endpoint
$RETURN_URL   = "https://playzone.com/return";       // After game ends
$CALLBACK_URL = "https://playzone.com/callback.php"; // Game result callback
$USER_ID      = 101;                                // Player ID
$BALANCE      = 500;                                // Player wallet balance
$GAME_UID     = 784512;                             // Unique game session ID

// Step 3: Encrypt data using AES-256-ECB
function ENCRYPT_PAYLOAD_ECB(array $DATA, string $KEY): string {
    if (strlen($KEY) !== 32) throw new Exception("Key must be 32 bytes long");
    $JSON = json_encode($DATA, JSON_UNESCAPED_UNICODE);
    $ENC  = openssl_encrypt($JSON, "AES-256-ECB", $KEY, OPENSSL_RAW_DATA);
    return base64_encode($ENC);
}

// Step 4: Prepare the data payload
$PAYLOAD = [
    "user_id"   => $USER_ID,
    "balance"   => $BALANCE,
    "game_uid"  => $GAME_UID,
    "token"     => $TOKEN,
    "timestamp" => round(microtime(true) * 1000), // current time in ms
    "return"    => $RETURN_URL,
    "callback"  => $CALLBACK_URL
];

// Step 5: Encrypt it
$ENCRYPTED = ENCRYPT_PAYLOAD_ECB($PAYLOAD, $SECRET);

// Step 6: Send it to the SoftAPI server
$URL = $SERVER_URL . "?payload=" . urlencode($ENCRYPTED) . "&token=" . urlencode($TOKEN);

$CH = curl_init($URL);
curl_setopt($CH, CURLOPT_RETURNTRANSFER, true);
$RESPONSE = curl_exec($CH);
curl_close($CH);

// Step 7: Decode the response
$DATA = json_decode($RESPONSE, true);

// Step 8: Show the result
if ($DATA["code"] == 0) {
    echo "✅ Game launched successfully!
"; echo "🎮 Game URL: " . $DATA["data"]["url"]; } else { echo "❌ Error: " . $DATA["msg"]; } ?>

Need Help with Integration?

Our technical support team is here to help you with any API integration questions.