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_keyStringRequired

Optional Integration Parameters

match_titleStringTournament lobby title
player_1_nameStringDisplay name for P1
player_1_logoURLAvatar URL for P1
player_2_nameStringDisplay name for P2
player_2_logoURLAvatar URL for P2
callback_urlURLFinal result webhook
win_urlURLRedirection for winner
lose_urlURLRedirection for loser
home_urlURLCustom redirection
end_timeDateExpiration 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_keyStringRequired
game_idNumberRequired

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'];