Calculate the API Signature

The following steps describe how to calculate the API signature.
  1. First, concatenate a string based on your request, as shown below: str_to_sign = {METHOD}|{PATH}|{TIMESTAMP}|{PARAMS}|{BODY}
    The PARAMS and BODY fields are optional. If a corresponding parameter is not present, leave it as an empty string.
  2. Use the hashlib library to apply SHA-256 to the string twice, as shown below:
  3. Sign the string with your API Secret, as shown below:
You have now calculated an API signature.

Signature Code Samples

Below are complete signature helper implementations in various languages. You can copy them directly into your project. Signature flow:
  1. Concatenate the string to sign: {METHOD}|{PATH}|{TIMESTAMP}|{PARAMS}|{BODY}
  2. Double SHA256 hash: sha256(sha256(str_to_sign))
  3. Sign with the Ed25519 private key
  4. Place the signature data in the request headers: BIZ-API-KEY, Biz-Api-Nonce, Biz-Api-Signature