> ## Documentation Index
> Fetch the complete documentation index at: https://doc.va777.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Signature

> How to generate the sign parameter required on every API call, with examples.

Every call to our services must include the `sign` parameter. `sign` is generated from the parameters you send plus your API key.

Fields marked **Signed** in each API's parameter list are included in the signature. `sign` itself is not.

## Steps

**1. Sort by key**

Sort the parameters by key in ascending order.

**2. URL-encode into a query string**

URL-encode each parameter and join them into a query string. Encoded characters must be **uppercase**; for example, `:` becomes `%3A`, not `%3a`.

**3. Append the API key and hash with MD5**

Append your API key directly to the query string. The MD5 of the result is `sign`.

## Example

For [Get game list](https://doc.va777.net/en/api-reference/game/list.md) with the API key `a188va`:

| Step | Result |
| - | - |
| Parameters | `lang=en-US` |
| Append API key | `lang=en-USa188va` |
| MD5 (`sign`) | `1e223cbbb0d30b1d3cc5e5764e1d88fa` |

## PHP example

```php sign.php theme={null}
<?php
    $data = array(
     "start_time" => "2020-07-01T00:00:00.000+08:00",
     "end_time" => "2020-07-02T00:00:00.000+08:00",
     "page_size" => 2000,
     "page" => 1
    );

    // $data: parameters to send; pass an empty array if there are none
    // $apiKey: your API key
    function generateSign($data, $apiKey)
    {
       ksort($data);

       $httpQuery = http_build_query($data);
       // end_time=2020-07-02T00%3A00%3A00.000%2B08%3A00&page=1&page_size=2000&start_time=2020-07-01T00%3A00%3A00.000%2B08%3A00

       $sign = md5($httpQuery . "$apiKey");
       // 4dc6c36f26c18020fe871d000789c611

       return $sign;
    }
?>
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.