Skip to content

Store player data for a game

POST
/setPlayerData

Optional. Stores a JSON object for one player in one game. The RGS
keeps it in its database, so it survives the session.

The request carries only the token. The RGS resolves player, game and
mode (REAL / DEMO) from it. Note the nesting: the payload to store
is data.data.

One entry is unique on player, game, currency, stake and mode.
The call replaces the entry with that key — it is an upsert, not an
append. currency and stake let one game hold several independent
entries for one player, for example one entry per stake level. Omit
both to hold one entry per player.

expires is optional and is an ISO 8601 timestamp in UTC. An entry
with no expires never expires. In DEMO mode the RGS caps the
lifetime at MAXLIFETIME_PLAYERDATA_INDEMOGAMES_SECONDS, 86400
seconds (24 hours) by default: it sets expires to the cap when the
request sends none, and lowers a later one to the cap. REAL mode
has no cap.

The reply is a read-back after the write. It contains the entries that
match the currency and stake of the request.

A request with no data.data fails with HTTP 400 and error 19
INVALIDPARAMETER.

Authorizations

V2AuthId

Game provider ID assigned by hizi.io (Hinterzimmer). Identifies which
shared secret the signature must be verified against. Mandatory on
every game engine / RGS call.

Type
API Key (header: X-H-AUTH-ID)
+
V2Signature

HMAC signature of the request. OpenAPI cannot express a computed
signature, so the scheme is modelled as an apiKey header; the value
is derived per request as follows.

You need a shared secret, which you can retrieve by logging in to the
hizi.io backoffice with your credentials. The signature is a
base64-encoded SHA-256 HMAC digest of a defined set of request
parameters, joined with a hash character (#). This allows the secret
to be shared without ever being sent in the request. A timestamp
(X-H-TIMESTAMP) must also be supplied as a request header and is part
of the signed data.

Outbound (you → hizi.io RGS) — the fields signed are the
serialised JSON body and the timestamp:

X-H-AUTH-SIG = base64(
  HMAC_SHA256( secret, [ JSON.stringify(body), X-H-TIMESTAMP ].join('#') )
)

See the Signing appendix for a complete
reference implementation.

Inbound (hizi.io RGS → your backendQueue) — same primitive, but
the RGS signs a fixed, per-endpoint ordered list of scalar fields
and the body is not hashed. The secret is used both as the HMAC key
and as the first element of the signed string:

X-H-AUTH-SIG = base64( HMAC_SHA256( secret, fields.join('#') ) )
endpoint fields (in order)
GET /getGameConfiguration [ secret, X-H-AUTH-ID, X-H-TIMESTAMP, currency ]
POST /getGameResult [ secret, X-H-AUTH-ID, X-H-TIMESTAMP, gameRound ]

A wrong signature is reported as HTTP 401 / error code 1001
(SIGNATUREWRONG) and must not be retried.

The header family is shared with the Operator API, which documents the
same base64/SHA-256-HMAC/#-joined construction; the set of signed
fields
differs per API and per direction, so do not assume a signer
written for one is reusable for the other without checking the field
list.

Type
API Key (header: X-H-AUTH-SIG)
+
V2Timestamp

ISO 8601 timestamp of the request (e.g. 2023-01-26T11:28:21.429Z).
Mandatory, and included in the signed data of X-H-AUTH-SIG.

Type
API Key (header: X-H-TIMESTAMP)

Parameters

Header Parameters

X-Request-Id*

Unique ID identifying the call in the logs. Documented as a mandatory
request header for all game engine / RGS calls.

Note: the reference implementation in the
Signing appendix additionally sets
X-Response-Id (a fresh UUID) and, when relaying a request,
X-Forwarded-Response-Id.

Type
string
Required
Example"8c00b93dd861405cbeb7c14fded1e72a"

Request Body

application/json
JSON
{
  
"token": "string",
  
"data": {
  
  
"currency": "EUR",
  
  
"stake": 0,
  
  
"data": "string",
  
  
"updated": "string",
  
  
"expires": "string"
  
}
}

Responses

The stored entries, read back after the write.

application/json
JSON
{
  
"data": [
  
  
{
  
  
  
"playerId": "ff85e29cb4414c89a89829c8411dacc2",
  
  
  
"gameId": "ff85e29cb4414c89a89829c8411dacc2",
  
  
  
"currency": "EUR",
  
  
  
"stake": 0,
  
  
  
"data": "string",
  
  
  
"updated": "string",
  
  
  
"expires": "string"
  
  
}
  
]
}

Samples

Powered by VitePress OpenAPI