RB7 Gaming Platform API
Integrate casino, slots, sports betting, and lottery games into your platform with our comprehensive API.
Introduction
Welcome to the RB7 Gaming Platform API. Our API provides seamless access to multiple game providers including casino games, slot machines, sports betting, and lottery systems.
Authentication
All API requests require JWT (JSON Web Token) authentication. Include your JWT token in the Authorization header of each request.
JWT Token Structure
Your JWT token should contain the following payload:
// Install: composer require firebase/php-jwt
use Firebase\JWT\JWT;
$secretKey = 'YOUR_SECRET_KEY';
$agentId = '1000';
$userId = 1;
$payload = [
'userId' => $userId,
'agentId' => $agentId,
'iat' => time(),
'exp' => time() + (60 * 60 * 24) // 24 hours
];
$jwt = JWT::encode($payload, $secretKey, 'HS256');
echo $jwt;
// Install: npm install jsonwebtoken
const jwt = require('jsonwebtoken');
const secretKey = 'YOUR_SECRET_KEY';
const agentId = '1000';
const userId = 1;
const payload = {
userId: userId,
agentId: agentId,
iat: Math.floor(Date.now() / 1000),
exp: Math.floor(Date.now() / 1000) + (60 * 60 * 24) // 24 hours
};
const token = jwt.sign(payload, secretKey);
console.log(token);
🔑 JWT Token Manager
Token will be saved in browser and used for all test requests below
Quick Start
Get started with the RB7 API in just a few steps:
- 1 Get Your Credentials Contact your account manager to receive your Agent ID and Secret Key
- 2 Generate JWT Token Use the authentication code above to create your JWT token
- 3 List Available Games Call the List Games API to see available games from providers
- 4 Launch a Game Get the game URL and display it in an iframe or webview
GETList Games
Retrieve a list of available games from a specific game provider. Currently supports Slot type games.
Get list of games from specified provider
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| game | string | Required | Game provider code (e.g., 'sa', 'pg', 'pragmatic') |
🧪 Try It Out
Example Request
$token = 'YOUR_JWT_TOKEN';
$baseUrl = 'https://game-api-staging.linexgaming.com';
$gameProvider = 'pg'; // PG Slot
$ch = curl_init($baseUrl . '/api/game/lists?game=' . $gameProvider);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: ' . $token,
'Content-Type: application/json'
]);
$response = curl_exec($ch);
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($statusCode === 200) {
$data = json_decode($response, true);
print_r($data['data']); // Array of games
}
const axios = require('axios');
const token = 'YOUR_JWT_TOKEN';
const baseUrl = 'https://game-api-staging.linexgaming.com';
const gameProvider = 'pg'; // PG Slot
try {
const response = await axios.get(`${baseUrl}/api/game/lists`, {
params: { game: gameProvider },
headers: {
'Authorization': token,
'Content-Type': 'application/json'
}
});
console.log(response.data.data); // Array of games
} catch (error) {
console.error('Error:', error.response?.data);
}
Example Response
{
"statusCode": 200,
"data": [
{
"code": "63d77314c7b4ea8acf592874",
"name": "Coffee Or Me Bingo",
"type": "arcade_bingo",
"active": true,
"order": 1,
"imageUrl": "https://download.x-gaming.com/assets/arcade/coffeeormebingo/banner.png"
}
],
"timestamp": "2022-07-07T15:57:37+00:00"
}
GETLaunch Game
Get the game URL to launch and display the game in an iframe or webview.
Launch a game and get the playable URL
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| game | string | Required | Game provider code |
| gameCode | string | Optional | Specific game code from list games API |
| isMobile | boolean | Optional | true for mobile, false for desktop |
| gameType | string | Optional | Game type (Only for kingmaker, jili, fc) |
🧪 Try It Out
Example Response
{
"statusCode": 200,
"data": "https://www.sai.slgaming.net/app.aspx?username=xxxx&token=F5277F0AE1D5009E67651054F0E4AE4A&lobby=A7720&lang=th&returnurl=",
"timestamp": "2022-07-07T15:57:37+00:00"
}
POSTUpdate User Credit
Update user's wallet balance. This endpoint is typically called by game providers via webhook to update credits after bets, wins, or cancellations.
Update user credit balance
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | number | Required | User ID |
| serviceName | string | Required | Service name (e.g., 'aecasino', 'sa', 'pg') |
| balance | number | Required | Update credit amount (positive/negative) |
| reference | string | Required | Reference transaction ID |
| action | string | Optional | Action type: bet, settle, cancel (Game Type casino or sport) |
Action Field Values
The action field specifies the type of transaction.
It is used for Game Type casino or sport. Additional action types
may be available depending on the provider.
Important: The action field is used
to describe the transaction type only, not to determine whether to
add or deduct balance. The actual balance adjustment (add or
deduct) is determined by the amount value sent:
positive values add balance, negative values deduct balance.
| Value | Description |
|---|---|
| bet | Used when a user places a bet. Deducts balance from user's wallet. |
| settle | Used when a bet is settled/won. Adds or deducts balance from user's wallet depending on the amount value (positive adds, negative deducts). |
| unsettle | Used to reverse a settled bet. Deducts balance from user's wallet. |
| cancel | Used when a bet is cancelled. Refunds balance to user's wallet. |
| rollback | Used to rollback a transaction. Reverses the previous transaction. |
| tips | Used when giving tips to dealer. Deducts balance from user's wallet. |
| cancel_tips | Used when cancelling tips. Refunds tips balance to user's wallet. |
| adjust_balance | Used to manually adjust user balance. Can be positive or negative. |
| promo | Used for promotional credits (RB7 Casino only). Adds balance to user's wallet. |
Note: Additional action types may be available depending on the provider. Please refer to your provider's documentation for the complete list of supported actions.
🧪 Try It Out
Example Response
{
"success": true
}
GETTransaction Detail
Retrieve detailed information about a specific game transaction including bet amount, win amount, and other transaction-specific data.
Get transaction details by transaction ID
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| game | string | Required | Game provider code. Supported providers: rb7-lotto, rb7sportbook, rb7-slot, rb7casino |
| id | string | Required | Transaction ID of the game (ticket id, bet id, ref id, or other transaction identifier) |
Supported Game Providers
The Transaction Detail API supports the following game providers:
| Code | Name | Type |
|---|---|---|
| rb7-lotto | RB7 Lotto | Lotto |
| rb7sportbook | RB7 Sportbook | Sport |
| rb7-slot | RB7 Slot | Slot |
| rb7casino | RB7 Casino | Casino |
🧪 Try It Out
Example Request
$token = 'YOUR_JWT_TOKEN';
$baseUrl = 'https://game-api-staging.linexgaming.com';
$game = 'rb7sportbook';
$transactionId = 'BET123456';
$ch = curl_init($baseUrl . '/api/game/transaction/detail?game=' . urlencode($game) . '&id=' . urlencode($transactionId));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: ' . $token,
'Content-Type: application/json'
]);
$response = curl_exec($ch);
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($statusCode === 200) {
$data = json_decode($response, true);
print_r($data);
}
const axios = require('axios');
const token = 'YOUR_JWT_TOKEN';
const baseUrl = 'https://game-api-staging.linexgaming.com';
const game = 'rb7sportbook';
const transactionId = 'BET123456';
try {
const response = await axios.get(`${baseUrl}/api/game/transaction/detail`, {
params: { game, id: transactionId },
headers: {
'Authorization': token,
'Content-Type': 'application/json'
}
});
console.log(response.data);
} catch (error) {
console.error('Error:', error.response?.data);
}
Example Response
{
"statusCode": 200,
"data": {
"bet_id": "BET123456",
"bet_amount": 100.00,
"win_amount": 250.00,
"status": "completed",
"url": "https://provider.com/bet/BET123456"
},
"timestamp": "2022-07-07T15:57:37+00:00"
}
GETList Users
Retrieve a list of all users under your agent account.
Get all users
🧪 Try It Out
This endpoint requires no additional parameters.
Example Response
{
"data": [
{
"id": 1,
"username": "test",
"firstName": "name",
"lastName": "lastname",
"credit": 1000.50
}
]
}
GETGet User By ID
Retrieve detailed information about a specific user.
Get user by ID
🧪 Try It Out
Example Response
{
"id": 1,
"username": "test",
"firstName": "name",
"lastName": "lastname",
"credit": 1000.50
}
Error Codes
Common HTTP error codes and their meanings in the RB7 API.
Game Providers
List of supported game providers and their codes.