Common parameters include common request parameters and common response parameters. To send a Short Message Service (SMS) API request, you must send an HTTP GET request to the SMS endpoint. You must add the request parameters that correspond to the API operation being called. After the request is processed, the system returns a result.
Common request parameters
Parameter | Type | Required | Description |
---|---|---|---|
Format | String | No | The format in which to return the response. Valid values:
JSON and XML. |
Version | String | Yes | The version number of the API, in the format of YYYY-MM-DD. Set this value to
2018-05-01. |
AccessKeyId | String | Yes | The AccessKey ID provided to you by Alibaba Cloud. |
Timestamp | String | Yes | The timestamp of the request. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ
format. The time must be in UTC.
For example, you can set this parameter to 2013-01-10T12:00:00Z, which indicates 20:00:00 on January 10, 2013 (UTC+8). |
SignatureNonce | String | Yes | A unique, random number used to prevent replay attacks.
You must use different numbers for different requests. |
Signature | String | Yes | The signature string of the current request. For more information about how signatures are calculated, see Signature method. |
SignatureMethod | String | Yes | The encryption method of the signature string. Set the value to HMAC-SHA1. |
SignatureVersion | String | Yes | The version of the signature encryption algorithm. Set the value to 1.0. |
Sample requests
https://dysmsapi.ap-southeast-1.aliyuncs.com/?Format=xml
&Version=2018-05-01
&Signature=Pc5WB8gokVn0xfeu%2FZV%2BiNM1dgI%3D
&SignatureMethod=HMAC-SHA1
&SignatureNonce=15215528852396
&SignatureVersion=1.0
&AccessKeyId=key-test
&OwnerId=12345678
&Timestamp=2014-10-10T12:00:00Z
Common response parameters
After you send an API request, the system returns a response in a uniform format. A returned HTTP status code 2xx indicates that the request is successful. A returned HTTP status code 4xx or 5xx indicates that the request fails. 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. For ease of reading, the sample responses are formatted. The actual responses do not include line breaks or indentations.
Every response returns a unique RequestId regardless of whether the call is successful.- XML format
<?xml version="1.0" encoding="utf-8"?> <!--Result Root Node--> <Interface Name+Response> <!--Return Request Tag--> <RequestId>4C467B38-3910-447D-87BC-AC049166F216</RequestId> <!--Return Result Data--> </Interface Name+Response>
- JSON format
{ "RequestId":"4C467B38-3910-447D-87BC-AC049166F216", /*Return Result Data*/ }