1. Getting Started
[Game] FairPlay API
  • Getting Started
    • Introduction
    • Session and Token
    • Request and Response
    • Real-time Events (SSE)
    • Lotto Rules — หวยเฮงเฮง
    • Provably Fair
  • Player
    • Demo
      • Demo Login
    • Player Bet History
      GET
  • Common
    • Game
      • By Game Code
        • Provably Fair
          • Set Client Seed
          • Verify Result
          • Get Revealed Server Seed
        • Check Session
        • Get Balance
        • Get Provably-Fair State
      • Lobby Game List
  • Wallet
    • Wallet Status
      GET
  • Game
    • Lotto (หวยเฮงเฮง)
      • Lotto Rules
      • Rooms
        • By Room
          • Join Round
          • Place Multi-player Bet
          • Get Round Result
          • Room Event Stream
      • Tickets
        • Create Ticket
        • Inquiry My Tickets
        • Get Ticket
      • Round
        • Get My Bets
        • Get My Result
        • Get Round Provably Fair
      • Results
        • Inquiry Results
      • Get Rooms
      • Get Current Round
      • Get Pay Table
  • Appendix
    • Game List
    • Error Codes
    • Rate Limits
  • Language List
    GET
  • Ping
    GET
  • Schemas
    • DemoLoginRequest
    • DemoLoginResponse
    • DemoProfileResponse
    • ProfileResponse
    • GetHistoryResponse
    • BetRecord
    • GameInfo
    • Room
    • GetGameResponse
    • BetRequest
    • Bet
    • BetResponse
    • BetResult
    • GetProvablyFairResponse
    • SetClientSeedRequest
    • SetClientSeedResponse
    • RotateServerSeedResponse
    • VerifyResultRequest
    • VerifyResultResponse
    • GetServerSeedResponse
    • GetStatusResponse
    • JoinRoundResponse
    • PlaceMultiPlayerBetRequest
    • PlaceBetResponse
    • RoundResultResponse
    • SuccessResponse
    • ErrorResponse
  1. Getting Started

Session and Token

Sending the token#

WhereFormatWhen
Header AuthorizationBearer {token} — capital B, one spaceEvery call except Demo Login, Languages and Ping
Query token?token={token}Only read when the header is absent. Use it for the room stream, because EventSource cannot send headers
The token is an opaque 64-character hex string. Do not parse it.

Session lifetime#

A session lives 12 hours from Start Game (or Demo Login).
Launching the game again for the same player (a new Start Game) ends the previous session — the old token then answers 10010.
A real player's session also ends when the player or the agent is suspended, or the agent's setup changes in the Backoffice.
A demo session is reused while it is alive: Demo Login with the same playerID returns the same token and keeps the balance.

When the session check fails#

HTTPcodeMeaningWhat the client should do
40199902Unauthorized. — no token was sentTreat as a client bug; do not retry
40110010Session expired. Please login again.Stop polling, tell the player the session ended, offer the reurl link
These two answers carry no validationError key.
Modified at 2026-09-30 13:23:45
Previous
Introduction
Next
Request and Response
Built with