Obtain Game Signature
This API must be called on the server side. Never call it directly from the frontend (APP client, web page, mini game, etc.) to avoid the risk of credential leakage. Used to obtain the game security signature.
API Description
API English name game.getSignature
Description Obtain the signature data of a specified game for launching the game by signature and accessing its metadata, such as the game name, icon, and version.
Note: This API requires secondary encryption and signing of server-to-server communication: request parameters must be encrypted and signed, and responses must be signature-verified and decrypted. This effectively prevents data tampering and leakage.
Call Method
HTTPS Call
POST /v1/game/signature?access_token=ACCESS_TOKENPrepend the base URL for your application's service region to the API path. See Service Regions and API Addresses.
Request Parameters - Query
| Field | Type | Default | Required | Description |
|---|---|---|---|---|
| access_token | string | Yes | API call credential |
Request Parameters - Body
| Field | Type | Default | Required | Description |
|---|---|---|---|---|
| game_id | string | Yes | Unique game identifier |
Return Value
The returned JSON data packet
| Field | Type | Description |
|---|---|---|
| errcode | int32 | Error code |
| errmsg | string | Error message |
| secret_enc_type | number | Package key encryption method, 0: plaintext, 1: XOR obfuscation + Base64, 2: reserved |
| game_meta_str | string | Game metadata JSON string |
| game_signature_hash | string | The signature value corresponding to game_meta_str |
game_meta_str Field Description
game_meta_str is a serialized JSON string. After parsing, its structure is as follows:
| Field | Type | Description |
|---|---|---|
| game_id | string | Unique game identifier |
| game_name | object | Game name (multi-language) |
| game_icon | string | Legacy game icon URL |
| icon | object | Game icon URLs by language, using the same map structure as game_name; language tags such as zh-CN are keys and default is the default value |
| game_version | string | Game version number |
| code_version | string | Code version number |
| package_url | string | Game resource package download URL |
| package_md5 | string | md5 value of the game package |
| package_secret | string | Game package decryption key, with the encryption method determined by secret_enc_type |
| secret_enc_type | number | Package key encryption method, 0: plaintext, 1: XOR obfuscation + Base64, 2: reserved |
| timestamp | number | Signature generation timestamp (seconds) |
| expires | number | Validity period length (seconds) |
| has_sub_package | boolean | Whether sub-packages exist |
Call Example
Note: The request example below shows the business data before encryption; what is actually sent is the ciphertext with signature headers, and the response example shows the business data after signature verification and decryption. See Server API Signature and Encryption for the packaging and signing rules.
Request Data Example
{
"game_id": "xxx"
}Response Data Example
{
"errcode": 0,
"errmsg": "ok",
"secret_enc_type": 1,
"game_meta_str": "{\"game_id\":\"2038447928785162241\",\"game_name\":{\"default\":\"opdemo\",\"zh-CN\":\"opdemo\"},\"game_icon\":\"https://example.com/icon.png\",\"icon\":{\"default\":\"https://example.com/icon.png\",\"zh-CN\":\"https://example.com/icon-zh-CN.png\"},\"game_version\":\"3.0.0\",\"code_version\":\"0\",\"package_url\":\"https://example.com/game-package.zip\",\"package_md5\":\"00000000000000000000000000000000\",\"package_secret\":\"ZXhhbXBsZV9wYWNrYWdlX3NlY3JldA==\",\"secret_enc_type\":1,\"timestamp\":1779950105,\"expires\":3600,\"has_sub_package\":false}",
"game_signature_hash": "xxx"
}The example response illustrates the data structure and cannot be used to launch a game.
