Signature Method
Last updated: 2025-11-26 11:28:46
Prerequisites
- Before using the signature method, you need to obtain your
access_keyandsecret_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-TYPEheader with the valueAKin 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, nonce, access_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
- The
signaturefield is not included in the signature calculation. - 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 - Append
nonceandaccess_keyto the message, for example:pageIdx=1123456FkxZwvrgm5tZ2iIW2cv98smcriekvt7uH4PaFieZ - Use
secret_keyto perform HMAC-SHA256 encryption on the message generated in step 3, then convert to hex to generate the signature. For example:7f2ef8b5f35efc22ebadc59bf4db8bf84995b8e56b6df8d8b030b6e744329bf0 - Finally, add the
signatureparameter to the request parameters to complete the signature, and submit to the server for validation.