Board Engine
Snake and Ladders logic
The digital definitive engine for the classic board game. Precise tile-based logic, real-time board sync, and automated ladder/snake movement validation.
Endpoint: Create Match
POST
https://games.tzsmm.com/api/snake-create-game
Mandatory Parameters
| api_key | String | Required |
Optional Integration Parameters
| match_title | String | Tournament lobby title |
| player_1_name | String | Display name for P1 |
| player_1_logo | URL | Avatar URL for P1 |
| player_2_name | String | Display name for P2 |
| player_2_logo | URL | Avatar URL for P2 |
| callback_url | URL | Final result webhook |
| win_url | URL | Redirection for winner |
| lose_url | URL | Redirection for loser |
| home_url | URL | Custom redirection |
| end_time | Date | Expiration date (ISO) |
Real Response JSON
{
"status": true,
"message": "Match Created Successfully",
"game_id": 1024,
"player_1_id": 405,
"player_2_id": 406,
"player_1_url": "https://games.tzsmm.com/snake/join/1024/P1",
"player_2_url": "https://games.tzsmm.com/snake/join/1024/P2"
}
Verify match status
Manually audit the status of any Snake & Ladders match. Essential for reconciling results if your server misses a callback.
POST
https://games.tzsmm.com/api/snake-games/status
| api_key | String | Required |
| game_id | Number | Required |
Status response
{
"status": true,
"game_id": 1024,
"game_status": "finished",
"winner": 405,
"message": "Game details fetched",
"players": [
{ "id": 405, "name": "Dev01", "logo": "...", "position": 100, "color": "#1976d2" }
]
}
Outcome Callback
The Snake engine triggers this callback when a player reaches tile 100 or is eliminated.
Payload Specification
{
"game_id": 1024,
"state": "finished",
"winner": 405
}
Code execution (PHP)
PHP Integration
$response = Http::post('https://games.tzsmm.com/api/snake-create-game', [
'api_key' => 'YOUR_API_KEY',
'callback_url' => 'https://yoursite.com/hook'
]);
echo $response['game_id'];