1. Demo
[Game] FairPlay API
  • Getting Started
    • Introduction
    • Session and Token
    • Request and Response
    • Real-time Events (SSE)
    • Lotto Rules — หวยเฮงเฮง
    • Provably Fair
  • Player
    • Demo
      • Demo Login
        POST
    • 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. Demo

Demo Login

POST
/gapi/v1/player/demo/login
Creates or resumes a demo (play-money) player session and returns its token. FE calls it when a game is opened in demo mode, before any authenticated call.
Auth: None
Rate limit: 100 requests per 60 s per IP (DEMO_LOGIN)
Rules
Public: no token needed and not blocked by maintenance (the calls made afterwards with the token still are).
All three body fields must be JSON strings; playerID sent as a JSON number answers 400 99911.
Omit playerID (or send "") to create a new demo player. The response returns a 10-digit playerID: store it and send it back to resume the same player, balance and history.
While the previous session is still alive (12 h from its creation), logging in again with the same playerID returns the SAME token and keeps the balance; name and currency are replaced and the 12 h lifetime is not extended.
Once the session has expired, the next login returns a new token and resets the balance to "10000.00".
currency is trimmed and upper-cased, must be 2–10 characters of A–Z / 0–9, and is not checked against the configured currencies — an unknown code later shows an empty symbolCurrency.
name is trimmed and must be 1–100 characters.
The token is a 64-character hex string; send it as Authorization: Bearer <token> (or ?token=<token>) on every authenticated call.
Flow
1.
Trims playerID and name; trims and upper-cases currency.
2.
Validates the fields (400 on failure, see errors).
3.
Generates a playerID when none was sent.
4.
If a session for that playerID is still alive, reuses its token and balance; otherwise creates a new 12 h session with balance 10000.00.
5.
Returns token, playerID, name, balance, currency and isDemo.

Request

Header Params

Body Params application/json

Examples

Responses

🟢200OK
application/json
Bodyapplication/json

🟠400Bad Request
🟠429Too Many Requests
🔴500Internal Server Error
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location 'https://dev-api.ambfairgame.com/gapi/v1/gapi/v1/player/demo/login' \
--header 'Accept-Language: th' \
--header 'Content-Type: application/json' \
--data '{
    "playerID": "9123456789",
    "name": "Demo Tester",
    "currency": "THB"
}'
Response Response Example
200 - Demo login
New or resumed demo session.
{
    "code": "0",
    "description": "Success.",
    "traceID": "0f8e2c1a-6b3d-4e5f-9a7b-1c2d3e4f5a6b",
    "data": {
        "token": "0ec1babc4dfabb3e4ed5e30a52b49a9af61d228dc463341ccec3778305644882",
        "playerID": "9123456789",
        "name": "Demo Tester",
        "balance": "10000.00",
        "currency": "THB",
        "isDemo": true
    }
}
Modified at 2026-09-30 13:23:45
Previous
Provably Fair
Next
Player Bet History
Built with