Common request and response parameters
Updated at:
This topic describes the common request and response headers for the Event Center APIs.
Common request headers
You must include common request parameters in every API call.
| Parameter | Example | Required | Description |
| Authorization | acs <yourAccessKeyId>:<yourSignature> | Yes | The authentication information used to verify the request. The format is AccessKeyId:Signature. |
| Content-Length | 0 | No | The length of the HTTP request body as defined in RFC 2616. |
| Content-Type | application/json | Yes | The content type of the HTTP request body as defined in RFC 2616. |
| Content-MD5 | 0e30656xxxxxxxxx0bc6f70bbdfe | Yes | The 128-bit MD5 hash of the HTTP message body, encoded in Base64. To prevent request tampering, include this header in all requests. |
| Date | Wed, 16 Dec 2015 11:18:47 GMT | Yes | The time when the request was initiated. Only the GMT format is supported. If the time difference between the request and the MNS server time exceeds 15 minutes, the request is considered invalid. |
| Host | gemp.cn-shanghai.aliyuncs.com | Yes | The endpoint of the service you want to access. For example, elasticsearch.<RegionId>.aliyuncs.com. |
| Accept | application/json | Yes | The response format that the client can accept. Valid values are application/json and application/xml. |
| x-acs-version | 1.0 | Yes | The API version number. The current version is 2017-06-13. |
| x-acs-region-id | cn-shanghai | Yes | The region ID. |
| x-acs-signature-nonce | f63659d4-10ac-483b-99da-ea8fde61eae3 | Yes | A unique random number used to prevent replay attacks. Use a different nonce for each request. |
| x-acs-signature-method | HMAC-SHA1 | Yes | The signature algorithm. Only HMAC-SHA1 is supported. |
Example
Action /config/all HTTP/1.1
Host: gemp.cn-shanghai.aliyuncs.com
Accept: application/json
User-Agent: cs-sdk-python/0.0.1 (Darwin/15.2.0/x86_64;2.7.10)
x-acs-signature-nonce: f63659d4-10ac-483b-99da-ea8fde61eae3
Authorization: acs <yourAccessKeyId>:<yourSignature>
x-acs-signature-version: 1.0
Date: Wed, 16 Dec 2015 11:18:47 GMT
x-acs-signature-method: HMAC-SHA1
Content-Type: application/json;charset=utf-8
X-Acs-Region-Id: cn-shanghai
Content-Length: 0Common response headers
The system returns a unique identifier, RequestId, for each API call, regardless of whether the call succeeds or fails. The data returned from an API call is in a unified format. An HTTP status code of 2xx indicates a successful call. An HTTP status code of 4xx or 5xx indicates a failed call.
XML example:
<?xml version="1.0" encoding="UTF-8"?>
<!--The root node of the result-->
<APIName+Response>
| <!--The request tag-->
| <RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId>
| <!--The response data-->
</APIName+Response>JSON example:
{
"RequestId": "4C467B38-3910-447D-87BC-AC049166F216"
/* The response data */
}| HTTP status code | Error code | Error message |
| 403 | ServiceNotOpen | Service not opened |
| 400 | ServiceStoped | Service stopped |
| 400 | InvalidParameter | The specified parameter is not valid. |
| 403 | NoPermission | The account does not have permission. |
| 500 | InternalError | Internal Error |
| 404 | ResourceNotFound | The specified resource is not found. |
| 404 | UserTypeNotExisted | The user type does not exist. |
| 403 | StsTokenNoPermission | The STS token does not have permission. |
| 403 | StsTokenNoWritePermission | The STS token does not have write permission. |
| 403 | UserNotAdded | The user was not added to the system. |
| 404 | ResourceEmpty | The resource ID is empty. |
| 403 | ResourceIdNotBelongTenant | The resource ID does not belong to the tenant ID. |
| 404 | TenantNotExisted | The specified tenant does not exist. |
Is this page helpful?