Updated on 2024-05-20 GMT+08:00

Common Message Headers

Common Request Headers

Table 1 Common request header fields

Parameter

Description

Mandatory

Example Value

Content-type

Request body type or format. Its default value is application/json.

Yes

application/json

X-Project-Id

Project ID, which is used to obtain the token of a project. For how to obtain the project ID, see Obtaining the Project ID/Account Name/AK/SK.

No

e9993fc787d94b6c886cbaa340f9c0f4

X-Auth-Token

User token, a response to the API used to obtain a user token. This API is the only one that does not require authentication.

This parameter is mandatory for token authentication.

-

X-Sdk-Date

Time when the request is sent. The time is in YYYYMMDD'T'HHMMSS'Z' format.

The value is the current Greenwich Mean Time (GMT) of the system.

This parameter is mandatory for AK/SK-based authentication, but not required for PKI token-based authentication

20190307T101459Z

Authorization

Signature authentication information.

The value is obtained from the request signature result and is required when the AK and SK are used to encrypt the signature.

Type: string

Default value: none

This parameter is mandatory for AK/SK-based authentication. For details about AK/SK-based authentication, see Authentication.

SDK-HMAC-SHA256 Credential=ZIRRKMTWPTQFQI1WKNKB/20150907//ec2/sdk_request, SignedHeaders=content-type;host;x-sdk-date, Signature=55741b610f3c9fa3ae40b5a8021ebf7ebc2a28a603fc62d25cb3bfe6608e1994

Host

Information about the requested server. The value can be obtained from the URL of the service API.

The value is hostname[:port].

If the port number is not specified, the default port is used. The default port number for https is 443.

This parameter is mandatory for AK/SK-based authentication.

code.test.com

or

code.test.com:443

For details about other parameters in the header, see the HTTPS protocol documentation.

Common Response Headers

Table 2 Common response headers

Parameter

Description

Mandatory

Content-Type

Media type of the message body sent to a receiver

Type: string

Default value: application/json; charset=UTF-8

Yes

X-request-id

This field carries the request ID for task tracing.

Type: string. request_id-timestamp-hostname (The request_id is the UUID generated on the server. timestamp indicates the current timestamp, and hostname is the name of the server that processes the current API.)

Default value: none

No

X-ratelimit

This field carries the total number of flow control requests.

Type: integer

Default value: none

No

X-ratelimit-used

This field carries the number of remaining requests.

Type: integer

Default value: none

No

X-ratelimit-window

This field carries the flow control unit.

Type: string. The unit is minute, hour, or day.

Default value: hour

No