API Manual

API Server Reference

This page documents the HTTP endpoints exposed by the API server, including request payloads, response shapes, and sample calls. All JSON endpoints use Content-Type: application/json unless noted otherwise.

Main API https://api{num}.qianxu168.com/
Default Response {"status":"ok"}
Error Shape {"status":"error","description":"..."}

Overview

JSON POST APIs Trusted IP Required Report endpoint uses localhost only

Most endpoints require a domain value that must be registered in the console panel and called from a trusted IP address. Error responses generally follow the same structure:

{
  "status": "error",
  "description": "human readable message"
}

Success responses usually include status: ok and endpoint-specific fields. Balance values are serialized as JSON numbers.

Game URL

POST
https://api{num}.qianxu168.com/game/url

Request JSON

{
  "id": "player-001",
  "domain": "example.com",
  "game": "provider/game-01",
  "balance": 1250.5,
  "agent": "web",
  "lobbyUrl": "https://example.com/lobby",
  "nickname": "Alice",
  "profile": "1",
  "level": 3
}

Required: id, domain, game, balance.

agent and lobbyUrl are optional.

For Card Game category: nickname, profile, and level are required. level must be 0-5.

Response JSON

{
  "status": "ok",
  "url": "https://game.example.com?id=player-001&passcode=abc123&domain=example.com&game=game-01&key=...&exit=https://example.com/lobby"
}

If game engine rejects the request, this endpoint forwards that engine response body.

Example

curl -X POST https://api{num}.qianxu168.com/game/url \
  -H 'Content-Type: application/json' \
  -d '{
    "id":"player-001",
    "domain":"example.com",
    "game":"provider/game-01",
    "balance":1250.5,
    "lobbyUrl":"https://example.com/lobby"
  }'

Create Player

POST
https://api{num}.qianxu168.com/player/account/create

Request JSON

{
  "playerId": "player-001",
  "playerNickname": "Alice",
  "profile": "1",
  "domain": "example.com",
  "agent": "browser",
  "playerType": "normal"
}

Required: playerId, playerNickname, profile, domain.

profile must be a base64 string or a number string from 1 to 12.

playerType defaults to normal when omitted.

Response JSON

{
  "status": "ok"
}

Common error example:

{
  "status": "error",
  "description": "player already exist"
}

Example

curl -X POST https://api{num}.qianxu168.com/player/account/create \
  -H 'Content-Type: application/json' \
  -d '{
    "playerId":"player-001",
    "playerNickname":"Alice",
    "profile":"1",
    "domain":"example.com",
    "agent":"browser"
  }'

Transfer Balance

POST
https://api{num}.qianxu168.com/balance/transfer

Request JSON

{
  "playerId": "player-001",
  "domain": "example.com",
  "amount": 100
}

amount cannot be zero.

Negative values withdraw balance. Withdrawals are blocked while the player is in a game.

Response JSON

{
  "status": "ok",
  "balance": 1350.5
}

Example

curl -X POST https://api{num}.qianxu168.com/balance/transfer \
  -H 'Content-Type: application/json' \
  -d '{
    "playerId":"player-001",
    "domain":"example.com",
    "amount":100
  }'

Game Start

POST
https://api{num}.qianxu168.com/game/start

Request JSON

{
  "playerId": "player-001",
  "domain": "example.com",
  "gameId": "provider/game-01",
  "lobbyURL": "https://example.com/lobby",
  "level": 3
}

Required: playerId, domain, gameId, lobbyURL.

If the game category is Card Game, level is required and must be between 0 and 5.

Response JSON

{
  "status": "ok",
  "gameURL": "https://game.example.com?id=player-001&passcode=abc123&domain=example.com&game=game-01&key=...&exit=https://example.com/lobby"
}

The handler may also return the raw game engine response if the game engine rejects the request.

Example

curl -X POST https://api{num}.qianxu168.com/game/start \
  -H 'Content-Type: application/json' \
  -d '{
    "playerId":"player-001",
    "domain":"example.com",
    "gameId":"provider/game-01",
    "lobbyURL":"https://example.com/lobby"
  }'

Session Terminate

POST
https://api{num}.qianxu168.com/game/session/terminate

Request JSON

{
  "playerId": "player-001",
  "domain": "example.com"
}

Response JSON

{
  "status": "ok"
}

When the player is not in a game, the endpoint returns an error response.

Example

curl -X POST https://api{num}.qianxu168.com/game/session/terminate \
  -H 'Content-Type: application/json' \
  -d '{"playerId":"player-001","domain":"example.com"}'

Player Status

POST
https://api{num}.qianxu168.com/player/account/status

Request JSON

{
  "playerId": "player-001",
  "domain": "example.com"
}

Response JSON

{
  "status": "ok",
  "balance": 1250.5,
  "playerState": "idle",
  "playerGame": ""
}

Example

curl -X POST https://api{num}.qianxu168.com/player/account/status \
  -H 'Content-Type: application/json' \
  -d '{"playerId":"player-001","domain":"example.com"}'

Game Detail

GET
https://api{num}.qianxu168.com/game/log/detail?reportId={reportId}

This endpoint also accepts transactionId instead of reportId.

Query Parameters

  • reportId: numeric report ID
  • transactionId: numeric transaction ID

One of the two parameters is required.

Response JSON

{
  "status": "ok",
  "url": "https://inspect{num}.qianxu168.com/66b8d..."
}

Example

curl "https://api{num}.qianxu168.com/game/log/detail?reportId=1001"