Signature Algorithm v2
Applying for Security Credentials
The security credential used in this document is a key, which includes an accessKeyId and an accessKeyPassword.
AccessKeyId: used to identify the API caller, which is just like a username.
AccessKeyPassword: used to authenticate the API caller, which is just like a password.
You must keep your security credentials private and avoid disclosure; otherwise, your assets may be compromised. If they are disclosed, please disable them as soon as possible.
You can apply for the security credentials according to Zenlayer Docs.
Signature Calculation Process
Zenlayer Open API v2 supports POST requests. Only Content-Type: application/json
is supported. The API is called in JSON format.
The following uses querying the list of bare metal instances in the Hong Kong region as an example to describe the steps of signature splicing.
Assuming that your AccessKeyId and AccessKeyPassword are AKIDz8krbsJ5yKBZQpn74WFkmLPx3
and Gu5t9xGARNpq86cd98joQYCN3
, respectively, if you want to view the status of the instance in the Hong Kong region whose bare metal instance name is "unnamed", then the request may be:
Request Headers:
1. Concatenating the CanonicalRequest String
Concatenate the canonical request string (CanonicalRequest) in the following pseudocode format:
2. Concatenating the String to Be Signed
The string to sign is concatenated as follows:
According to the preceding rules, the string to be signed obtained in the example is as follows:
3. Calculating the Signature Based on AK and StringToSign
Calculate the derived signature key with the following pseudocode:
4. Concatenating the Authorization
The Authorization is concatenated as follows:
Last updated