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.

ParameterExampleRequiredDescription
Authorizationacs <yourAccessKeyId>:<yourSignature>YesThe authentication information used to verify the request. The format is AccessKeyId:Signature.
Content-Length0NoThe length of the HTTP request body as defined in RFC 2616.
Content-Typeapplication/jsonYesThe content type of the HTTP request body as defined in RFC 2616.
Content-MD50e30656xxxxxxxxx0bc6f70bbdfeYesThe 128-bit MD5 hash of the HTTP message body, encoded in Base64. To prevent request tampering, include this header in all requests.
DateWed, 16 Dec 2015 11:18:47 GMTYesThe 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.
Hostgemp.cn-shanghai.aliyuncs.comYesThe endpoint of the service you want to access. For example, elasticsearch.<RegionId>.aliyuncs.com.
Acceptapplication/jsonYesThe response format that the client can accept. Valid values are application/json and application/xml.
x-acs-version1.0YesThe API version number. The current version is 2017-06-13.
x-acs-region-idcn-shanghaiYesThe region ID.
x-acs-signature-noncef63659d4-10ac-483b-99da-ea8fde61eae3YesA unique random number used to prevent replay attacks. Use a different nonce for each request.
x-acs-signature-methodHMAC-SHA1YesThe 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: 0

Common 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 codeError codeError message
403ServiceNotOpenService not opened
400ServiceStopedService stopped
400InvalidParameterThe specified parameter is not valid.
403NoPermissionThe account does not have permission.
500InternalErrorInternal Error
404ResourceNotFoundThe specified resource is not found.
404UserTypeNotExistedThe user type does not exist.
403StsTokenNoPermissionThe STS token does not have permission.
403StsTokenNoWritePermissionThe STS token does not have write permission.
403UserNotAddedThe user was not added to the system.
404ResourceEmptyThe resource ID is empty.
403ResourceIdNotBelongTenantThe resource ID does not belong to the tenant ID.
404TenantNotExistedThe specified tenant does not exist.