Skip to main content

Call Method

Signature Method

Last updated: 2025-11-26 11:28:46

Prerequisites

  • Before using the signature method, you need to obtain your access_key and secret_key. If you haven't obtained them yet, please refer to the Key Management guide to create and save your keys.
  • To access services using the access key method, you need to set the X-AUTH-TYPE header with the value AK in your request headers.

Signature Parameters

Parameter Type Description
access_key string Application access identifier
secret_key string Encryption key
nonce string Unix timestamp, the server will validate the time difference within 30 seconds from the current time
signature string Signature

When requesting services, nonceaccess_key, and signature should be set in the URI querystring, and the X-AUTH-TYPE header should be set to AK in the request headers, for example:

/gpu/api/v1/service/cloudregion?pageIdx=1&access_key=xx&nonce=123456&signature=xx

Request headers:

X-AUTH-TYPE: AK

Signature Algorithm

  1. The signature field is not included in the signature calculation.
  2. Sort the JSON request parameters by key in ASCII ascending order to generate the signature message. Empty values are not included in the signature calculation. For example: pageIdx=1
  3. Append nonce and access_key to the message, for example: pageIdx=1123456FkxZwvrgm5tZ2iIW2cv98smcriekvt7uH4PaFieZ
  4. Use secret_key to perform HMAC-SHA256 encryption on the message generated in step 3, then convert to hex to generate the signature. For example: 7f2ef8b5f35efc22ebadc59bf4db8bf84995b8e56b6df8d8b030b6e744329bf0
  5. Finally, add the signature parameter to the request parameters to complete the signature, and submit to the server for validation.