Common request parameters

Common request parameters must be included in all ApsaraDB for MongoDB API requests.

Common request parameters

Parameter Type Required Description
Format String Yes The format in which to return the response. Valid values: JSON and XML. Default value: XML.
Version String Yes The API version, in the format of YYYY-MM-DD. The current version is 2015-12-01.
AccessKeyId String Yes The AccessKey ID provided to you by Alibaba Cloud.
Signature String Yes The signature string of the current request.
SignatureMethod String Yes The encryption method of the signature string. Set the value to HMAC-SHA1.
Timestamp String Yes
  • The timestamp at which you send the request. Specify the time in the ISO 8601 standard.
  • The format is YYYY-MM-DDThh:mm:ssZ. Example: 2016-01-01T12:00:00Z.
SignatureVersion String Yes The version of the signature encryption algorithm. Set the value to 1.0.
SignatureNonce String Yes A unique random number used to prevent replay attacks. You must use different numbers for different requests.

Sample requests

https:// mongodb.aliyuncs.com/?Action=<API Name>
?Format=json
&Version=2015-12-01
&Signature=Pc5WB8gokVn0xfeu%2FZV%2BiNM1dgI%3D 
&SignatureMethod=HMAC-SHA1
&SignatureNonce=15215528852396
&SignatureVersion=1.0
&AccessKeyId=key-test
&Timestamp=2016-01-01T12:00:00Z

Common response parameters

When you call an operation, the system returns the globally unique identifier (GUID) of the request through the RequestId parameter, regardless of whether the request is successful.

Sample responses

<?xml version="1.0" encoding="utf-8"?> 
<!--Result Root Node-->
<Interface Name+Response>
<!--Return Request Tag-->
<RequestId>4C4fdsf38-3910-447D-87AD-AC078932216</RequestId>
<!--Return Result Data-->
</Interface Name+Response>

Returned results

API responses use the HTTP response format:
  • A 2xx status code indicates a successful call.
  • A 4xx or 5xx status code indicates a failed call.
Responses can be returned in either the JSON or XML format. You can specify the response format in the request. The default response format is XML.
Note The response examples in this section have been formatted with line breaks or indents for a clear view. The actual responses are not properly formatted as these examples.

Sample success responses

XML format

The responses in the XML format include the result of the request and the details of the operation. Example:

<?xml version="1.0" encoding="utf-8"?> 
<!--Result Root Node-->
<Interface Name+Response>
<!--Return Request Tag-->
<RequestId>4C4fdsf38-3910-447D-87AD-AC078932216</RequestId>
<!--Return Result Data-->
</Interface Name+Response>

JSON format

{
"RequestId": "4C4fdsf38-3910-447D-87AD-AC078932216",
/* Return Result Data */
}

Sample error responses

If an error occurs when you call an API operation, no result data is returned. You can locate the cause of the error by referring to Error codes in Appendix. If an error occurs when you call an API operation, a 4XX or 5XX HTTP status code is returned. The returned message includes the specific error code and message. a globally unique request ID (RequestId), and the ID of the site you accessed with this request (HostId).

If you cannot locate the cause of the error, contact Alibaba Cloud customer service and provide them with HostId and RequestId to help solve the problem.

XML format

<?xml version="1.0" encoding="UTF-8"?>
<Error>
<RequestId>8906582E-6722-409A-A6C4-0E7863B733A5</RequestId>
<HostId> mongodb.aliyuncs.com</HostId>
<Code>UnsupportedOperation</Code>
<Message>The specified action is not supported.</Message>
</Error>

JSON format

{
"RequestId": "7463B73D-35CC-4D19-A010-6B8D65D242EF",
"HostId": " mongodb.aliyuncs.com",
"Code": "UnsupportedOperation",
"Message": "The specified action is not supported."
}