API Documentation
1. General Information
- API Server URL:
https://yjmelqyefm.net/api
- API Key:
70Bp3tGkuV4jUfcxupDNg6Hrk
- Shop ID:
1
- Currency:
TRY
- Timestamp: Generated using the
time()
function for each call.
2. Signature Generation
Each API request is signed using HMAC SHA256 algorithm with the API key.
function generateSignature($path, $apiKey) {
return hash_hmac('sha256', $path, $apiKey);
}
// Örnek kullanım:
$path = "/allgames/1/{timestamp}";
$signature = generateSignature($path, "JnaJWxTX7X9Cno9SqtYuo18KG");
The generated signature is appended to the API call URL:
https://yjmelqyefm.net/api/allgames/1/{timestamp}/{signature}
3. API Call
Function to fetch all games:
function sendApiRequest($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
if (curl_errno($ch)) {
die("cURL Hatası: " . curl_error($ch));
}
curl_close($ch);
return json_decode($response, true);
}
4. Game URL Generation
Mobile: If game
and category
parameters are set, the user is redirected as follows:
$gamePath = "/game/{category}/{game_name}/1/{login_user_name}/{timestamp}";
$gameSignature = generateSignature($gamePath, $apiKey);
$redirectUrl = $apiServerUrl . $gamePath . '/' . $gameSignature . "?currency=BGN";
header("Location: " . $redirectUrl);
exit;
Desktop: The game URL is loaded in an iframe
.
$iframeGameUrl = $apiServerUrl . $gamePath . '/' . $gameSignature . "?currency=BGN";
5. Application Flow
- All games are fetched via the
/allgames/1/{timestamp}
endpoint.
- Games are filtered by category.
- Based on the user device (mobile/desktop), the corresponding game URL is generated and either redirected or loaded in an
iframe
.
- User session is checked; if invalid, the user is redirected to the login page.
- getuserdata: getuserdata: Fetches the balance for the specified username.
- update balance: update balance: Updates the user's balance based on the provided parameters.
This structure allows you to seamlessly integrate your slot games into your system with API integration, user balance inquiry, and balance update functionalities.