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

# Signing

Each endpoint is labeled with an auth type. `SIGNED` means the endpoint requires a valid signature to access. `KEYED` means the endpoint only requires an API KEY in the request header.

#### Auth Types

* `NONE` : Public endpoint, accessible by anyone
* `KEYED` : Requires a valid X-API-KEY
* `SIGNED` : Requires a valid X-API-KEY and signature X-API-SIGN

#### 1. Setting Request Parameters

**Header Key Settings**

* `X-API-KEY` (Your API Access KEY)
* `X-API-SIGN` (HmacSHA256 signature)
* `X-API-TIMESTAMP` (Current timestamp of the request, in milliseconds)

```text theme={null}
// X-API-TIMESTAMP Generation

// Java
System.currentTimeMillis();

// Python
int(time.time() * 1000)

// Golang
time.Now().UnixNano() / int64(time.Millisecond)

// Nodejs & TypeScript
Date.now();

// Javascript
Date.now();

// PHP
round(microtime(true) * 1000)

// C#
DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
```

**Body Parameter Settings**

* For `GET/DELETE` requests, query string is in form format: `symbol=BMX&side=BUY`
* For `POST/PUT` requests, query string is in json format: `{"symbol":"BMX","side":"BUY"}`

#### 2. Example

* Request endpoint: `/account/v1/transfer-contract` (SIGNED)
* Request method: POST
* Assume current timestamp: timestamp= `1589793796145`
* request body=`{"currency":"USDT","amount":"10","transferType":"spot_to_contract"}`

Then set as follows:

* X-API-TIMESTAMP= `1589793796145`
* X-API-KEY= `Your_api_access_key`
* X-API-SIGN= hmac\_sha256( `Your_api_secret_key` , `X-API-TIMESTAMP` + '#' + `Your_api_memo` + '#' + `'{"currency":"USDT","amount":"10","transferType":"spot_to_contract"}'`)

Assume the API credentials are as follows:

* accessKey =`80618e45710812162b04892c7ee5ead4a3cc3e56`
* secretKey =`6c6c98544461bbe71db2bca4c6d7fd0021e0ba9efc215f9c6ad41852df9d9df9`
* memo =`test001`

The following is a complete request

```shell theme={null}
# Shell Complete Request Example

echo -n '1589793796145#test001#{"currency":"USDT","amount":"10","transferType":"spot_to_contract"}' \
  | openssl dgst -sha256 -hmac "6c6c98544461bbe71db2bca4c6d7fd0021e0ba9efc215f9c6ad41852df9d9df9"
# (stdin)= bbd57e119c53e7cd28c5097f596822173fbf883c94c8bcc9a61ec2da9e143778

curl --location --request POST 'https://cloud-api.wooxpro.com/account/v1/transfer-contract' \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: 80618e45710812162b04892c7ee5ead4a3cc3e56' \
  --header 'X-API-SIGN: bbd57e119c53e7cd28c5097f596822173fbf883c94c8bcc9a61ec2da9e143778' \
  --header 'X-API-TIMESTAMP: 1589793796145' \
  --data '{"currency":"USDT","amount":"10","transferType":"spot_to_contract"}'
```
