ZynVerse API Docs

Complete Documentation & Integration Guide
POST
HTTP Method
JWT
Authentication
3
Database Tables
2
Code Examples

API Overview

This API handles game launching functionality with wallet balance management and integration with the HuidoVerse gaming platform. It provides secure JWT-based authentication, wallet balance transfers, and seamless game launching capabilities.

launchurl
Base URL
JWT Bearer Token
Authentication
Asia/Kolkata
Timezone

Request Headers

Header Value Description
Authorization Bearer {jwt_token} Required for JWT authentication
Content-Type application/json Required for JSON payload
X-API-Key {api_key} Required for API access
HTTP_ORIGIN Client origin for CORS Required for API access

Request Parameters

Required Parameters

Parameter Type Description Example
language string Language code (e.g., "en") en
random string Random string for security a1b2c3d4e5f6
signature string MD5 signature for request validation D41D8CD98F00B204E9800998ECF8427E
timestamp string Current timestamp 2024-01-01 12:00:00
vendorCode string Vendor identifier code 18
gameCode string Unique game identifier game123

Optional Parameters

Parameter Type Description Example
gameNameEn string Game name in English Poker Game
phonetype string Device type mobile

Signature Generation

All requests must include a valid MD5 signature for security validation.

PHP
// Signature Generation Algorithm
$signString = '{"gameCode":"' . $gameCode . '","language":' . $language . ',"phonetype":' . $phonetype . ',"random":"' . $random . '","vendorCode":' . $vendorCode . '}';
$signature = strtoupper(md5($signString));

// Example:
// gameCode: "game123", language: "en", phonetype: "mobile", random: "random123", vendorCode: "18"
// Signature: CDF472ADF59FC5E644C6F20942C79892

Response Formats

Success Response

JSON
{
    "code": 0,
    "msg": "Game launched successfully",
    "msgCode": 0,
    "serviceNowTime": "2024-01-01 12:00:00",
    "data": {
        "url": "https:\/\/game-provider.com\/launch",
        "returnType": "game_url"
    }
}

Error Responses

Code HTTP Status Message Description
4 401 No operation permission JWT validation failed or user not found
5 200 Wrong signature Signature verification failed
7 200 Param is Invalid Missing required parameters
8 500 API configuration error / Failed to launch game Reseller credentials issue or API call failure
11 405 Method not allowed Invalid HTTP method

Code Examples

JavaScript
/**
 * JavaScript Client Example
 */
async function launchGame(gameCode, vendorCode, jwtToken) {
    const language = 'en';
    const random = generateRandomString(12);
    const timestamp = new Date().toLocaleString("en-IN", {timeZone: "Asia/Kolkata"});
    
    // Generate signature
    const signString = `{"gameCode":"${gameCode}","language":${language},"phonetype":"mobile","random":"${random}","vendorCode":${vendorCode}}`;
    const signature = md5(signString).toUpperCase();
    
    try {
        const response = await fetch('/api/gamesintrigrated.php', {
            method: 'POST',
            headers: {
                'Authorization': 'Bearer ' + jwtToken,
                'Content-Type': 'application/json',
                'X-API-Key': 'your-api-key'
            },
            body: JSON.stringify({
                language: language,
                random: random,
                signature: signature,
                timestamp: timestamp,
                vendorCode: vendorCode,
                gameCode: gameCode,
                phonetype: 'mobile',
                gameNameEn: 'Demo Game'
            })
        });
        
        const result = await response.json();
        
        if (result.code === 0) {
            // Redirect to game URL
            window.location.href = result.data.url;
        } else {
            console.error('Game launch failed:', result.msg);
            alert('Failed to launch game: ' + result.msg);
        }
        
        return result;
    } catch (error) {
        console.error('Network error:', error);
        throw error;
    }
}

// Helper function to generate random string
function generateRandomString(length) {
    const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    let result = '';
    for (let i = 0; i < length; i++) {
        result += chars.charAt(Math.floor(Math.random() * chars.length));
    }
    return result;
}