Skip to main content

Signature Rules

Signature rules

To ensure the security and validity of the request, all requests must contain the following custom request header fields. These fields are used for authentication and request integrity verification.

API request header parameter description
NameTypeRequiredDescription
X-Api-Key string[64]yesapi-key
X-Api-Nonce string[32] yesRandom string
X-Api-Timestamp string[10] yesUnix timestamp time
X-Api-Signature string yesSignature hash value
Signature Rules
  • All requests [Header] that require authentication must contain the following key:
  • Content-Type: uniformly set to application/json

    X-Api-Key: api key

    X-Api-Nonce: random string, fixed length 32 bits

    X-Api-Timestamp: the current 10-digit Unix timestamp of the request (time window offset ≤ 5s)

    X-Api-Signature: signature string

  • Signature rules:
  • queryString: the query string in the request URL (the request parameter after the ?). Urlencode is required; if the request URL does not have a Query parameter, queryString can be omitted

    bodyString: json string corresponding to the request body, for example {"k":"v"} . If there is no request body (usually a GET request), bodyString can be omitted

    Special note: Please ensure that the order of parameters involved in the signature is consistent with the order of parameters in the actual request, otherwise the signature verification will fail

  • Signature string concatenation format:
  • X-Api-Key + X-Api-Nonce + X-Api-Timestamp + queryString + bodyString

  • Use apisecret as the key, perform sha256 hash algorithm operation (hmac sha256), obtain the signature character, and use hex encoding to obtain the signature string sign
  • Put sign in Hedaer X-Api-Signature