API Key
API Credentials
Your secure API integration keys.
Authentication Keys
Keep these tokens secret!
This prefix is automatically pre-pended to all your User IDs.
https://oxentech.asia/api/devtools.php
https://demo.com/api/webapi/Callback.php
System Integration
// npm install axios
const axios = require('axios');
const API_CONFIG = {
url: 'https://oxentech.asia/api/devtools.php',
token: 'YOUR_API_TOKEN',
secret: 'YOUR_SECRET_KEY'
};
async function launchGame(user, gameCode) {
try {
const payload = {
ValidationToken: API_CONFIG.token,
GameId: gameCode,
PlayerId: user.id,
PlayerName: user.username,
Currency: 'INR',
ReturnUrl: 'https://your-site.com/exit'
};
const response = await axios.post(API_CONFIG.url, payload);
if(response.data.status === 200) {
return response.data.gameUrl;
} else {
console.error('Launch Error:', response.data.msg);
}
} catch (error) {
console.error('API Error:', error.message);
}
}
// Express.js Route Handler
app.post('/api/callback', async (req, res) => {
const data = req.body;
// 1. Get Balance
if(data.Type === 'getBalance') {
const balance = await db.getUserBalance(data.PlayerId);
return res.json({
status: 200,
balance: balance
});
}
// 2. Deduct Bet
if(data.Type === 'deductBalance') {
const newBal = await db.deductUser(data.PlayerId, data.amount);
return res.json({
status: 200,
balance: newBal
});
}
// 3. Add Win
if(data.Type === 'addToBalance') {
const newBal = await db.creditUser(data.PlayerId, data.amount);
return res.json({
status: 200,
balance: newBal
});
}
res.json({ status: 400, msg: 'Unknown Type' });
});
<?php
$url = 'https://oxentech.asia/api/devtools.php';
$api_token = 'YOUR_API_TOKEN';
$payload = [
'ValidationToken' => $api_token,
'GameId' => 'pgsoft-mahjong-ways',
'PlayerId' => 'user_123',
'PlayerName' => 'John Doe',
'Currency' => 'INR',
'ReturnUrl' => 'https://mysite.com/lobby'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$result = json_decode($response, true);
if($result['status'] == 200) {
// Redirect user to game
header("Location: " . $result['gameUrl']);
} else {
echo "Error: " . $result['msg'];
}
?>
<?php
$data = json_decode(file_get_contents('php://input'), true);
$player = $data['PlayerId'] ?? null;
$type = $data['Type'] ?? null;
// 1. Get Balance Request
if ($type === 'getBalance') {
$balance = getUserBalance($player);
echo json_encode([
'status' => 200,
'balance' => $balance
]);
}
// 2. Deduct Bet
elseif ($type === 'deductBalance') {
$amount = $data['amount'];
$newBal = deductBalance($player, $amount);
echo json_encode([
'status' => 200,
'balance' => $newBal
]);
}
// 3. Add Win
elseif ($type === 'addToBalance') {
$amount = $data['amount'];
$newBal = addBalance($player, $amount);
echo json_encode([
'status' => 200,
'balance' => $newBal
]);
}
?>