Common & Transfer Introduction
How This API Works
Section titled “How This API Works”Each section in the API sidebar usually represents a specific endpoint. In this case, we’re using the game_lobby endpoint as an example.
Example Endpoint
Section titled “Example Endpoint”- Route:
/game_lobby - Method:
GET
Request Specification
Section titled “Request Specification”Query Parameters
Section titled “Query Parameters”| Name | Type | Required | Description |
|---|---|---|---|
agent_id | string | ✅ | - |
time | number | ✅ | Unix Timestamp |
data | string | ✅ | Base64 Encoded Data |
key | string | ✅ | MD5 Hash Key |
Sample Request URL
Section titled “Sample Request URL”api_base_url/api/v2/game_lobby?agent_id=sampleApiId&time=1747896074&data=dXNlcl9pZD...&key=77f9856869...Response Specification
Section titled “Response Specification”- HTTP Status:
200
Response Body
Section titled “Response Body”interface IGameLobby { result_code: number response_data: { game_url: string }}Structuring Request
Section titled “Structuring Request”Follow the steps outlined in the section to construct the request.
Properties
Section titled “Properties”| Property | Type | Required | Default | Description |
|---|---|---|---|---|
user_id | string | ✅ | - | |
currency | string | ✅ | - | Example:KRW,USD,JPY,CNY,PHP,HKD,THB,VND,BDT,INR |
language | string | ✅ | - | Example:KO = Korean, EN = English,CN = Chinese, JP = Japanese. |
home_url | string | ❌ | - | |
feedback_data1 | string | ❌ | - | |
bet_n_min | number | ✅ | - | |
bet_n_max | number | ✅ | - | |
bet_t_min | number | ✅ | - | |
bet_t_max | number | ✅ | - | |
bet_r_min | number | ✅ | - | |
bet_r_max | number | ✅ | - |
Required Inputs on Server
Section titled “Required Inputs on Server”Before you send a request, you must know this and the following:
| Field | Description | How to get it |
|---|---|---|
| API ID or Agent Id | Agent identifier | From your agent account |
| API Key or Agent Key | Secret key for the ID | Inside your account’s information tab |
| API Base URL | Server address | e.g. http://stage.dwclub6789.com:9000/api/v2 |
-
Each required property should be formatted as
key=value. Then, concatenate all such properties using the&character to form a single string.Example:
user_id=sampleUserId¤cy=KRW&language=KO&home_url=https://sample.com&bet_n_max=50000&bet_n_min=50&bet_t_max=50&bet_t_min=1000&bet_r_max=50&bet_r_min=1000 -
After structuring the data as a concatenated string in the key=value format separated by &, encode the entire string using Base64 encoding.
Sample Code:
const structuredData ='user_id=sampleUserId¤cy=KRW&language=KO&home_url=https://sample.com&bet_n_max=50000&bet_n_min=50&bet_t_max=50&bet_t_min=1000&bet_r_max=50&bet_r_min=1000';const base64EncodedData = Buffer.from(structuredData).toString('base64');// Output: dXNlcl9pZD...Sample Output:
dXNlcl9pZD0yNzEwdDAwMSZjdXJyZW5jeT1LUlcmbGFuZ3VhZ2U9S08maG9tZV91cmw9aHR0cHM6Ly9zYW1wbGUuY29tJmJldF9uX21heD01MDAwMCZiZXRfbl9taW49NTAmYmV0X3RfbWF4PTUwJmJldF90X21pbj0xMDAwJmJldF9yX21heD01MCZiZXRfcl9taW49MTAwMCZhcGlfaWQ9c2FtcGxlQXBpSWQmYXBpX2tleT1jYjM1MTUwYTQ0NmQ0ZDM4YTI3ODk0ZDQ2MzIxZDVlMA== -
To prepare the data for hashing, concatenate
API Id,Unix Timestamp,API Key, and theBase64-encoded datain that exact order, without adding any delimiters between them.API Id + Unix Timestamp + API Key + Base64 Encoded DatasampleApiId1747888709cb35150a446d4d38a27894d46321d5e0dXNlcl9pZD0yNzEwdDAwMSZjdXJyZW5jeT1LUlcmbGFuZ3VhZ2U9S08maG9tZV91cmw9aHR0cHM6Ly9zYW1wbGUuY29tJmJldF9uX21heD01MDAwMCZiZXRfbl9taW49NTAmYmV0X3RfbWF4PTUwJmJldF90X21pbj0xMDAwJmJldF9yX21heD01MCZiZXRfcl9taW49MTAwMCZhcGlfaWQ9c2FtcGxlQXBpSWQmYXBpX2tleT1jYjM1MTUwYTQ0NmQ0ZDM4YTI3ODk0ZDQ2MzIxZDVlMA== -
Use the MD5 hash function to compute the hash of the concatenated data string.
// API Id + Unix Timestamp + API Key + Base64 Encoded Dataconst preHashData ='sampleApiId1747888709cb35150a446d4d38a27894d46321d5e0dXNlcl9pZD0yNzEwdDAwMSZjdXJyZW5jeT1LUlcmbGFuZ3VhZ2U9S08maG9tZV91cmw9aHR0cHM6Ly9zYW1wbGUuY29tJmJldF9uX21heD01MDAwMCZiZXRfbl9taW49NTAmYmV0X3RfbWF4PTUwJmJldF90X21pbj0xMDAwJmJldF9yX21heD01MCZiZXRfcl9taW49MTAwMCZhcGlfaWQ9c2FtcGxlQXBpSWQmYXBpX2tleT1jYjM1MTUwYTQ0NmQ0ZDM4YTI3ODk0ZDQ2MzIxZDVlMA==';const hashKey = crypto.createHash('md5').update(preHashData).digest('hex');// Output: fb362519233ae647d7906d7ebbe0a72e -
Structure the request URL as follows:
const requestUrl =`${api_base_url}/api/v2/game_lobby?` +`agent_id=${apiId}&` +`time=${unixTimestamp}&` +`data=${base64EncodedData}&` +`key=${hashKey}`; -
Request URL Usage.
Sample Usage:
const response = await axios.get(requestUrl);const data = response.data;/*Output:{"result_code": 0,"response_data": {"game_url": "https://game_url.com/api/game_lobby/?token=eyJhbGciOiJIUzI1NiIs..."}}*/Sample Response:
{"result_code": 0,"response_data": {"game_url": "https://game_url.com/api/game_lobby/?token=eyJhbGciOiJIUzI1NiIs..."}}