Sending SMS
Send Limit
You can send as many messages as you like. However, Yunpian have some rules for harassment prevention.
Harassment Prevention:
The same content can only be send once in 30 seconds, no more than 3 times in 5 minutes. Contact with customer service team if you have special needs.
HTTP Header:
Accept: application/json;charset=utf-8; Content-Type:application/x-www-form-urlencoded;charset=utf-8;
URL: https://yunpian.com/v2/sms/single_send.json
Request:
Method: POST
Request Parameter:
| PARAMETER | TYPE | REQUIRED | DESCRIPTION | EXAMPLE |
|---|---|---|---|---|
| apikey | string | Yes | APIKEY is credentials you can find on the "Account Dashboard" page. It is the string of 32-bit characters. | 9b11127a9701975c734b8aee81ee3526 |
| mobile | string | Yes | The destination phone, we only support single send.International SMS:The international mobile number must contain the country code. It must begin with"+". Please encode"+"with urlencode. | 15205201314 or urlencode("+93701234567") |
| text | string | Yes | The text of the message you want to send, limited to 500 words. It should be audited by our customer service team first. | 【Yunpian】Your Verify Code is 12345. |
| uid | string | No | The SMS ID in your application. It is created by yourself. | 10001 |
| callback_url | string | No | After SMS sending, the status report will be pushed to this address (the status is returned by carrier). If the push address is fixed, it is recommended to make the batch setting in "Data Push and Get". If address has been set in the "Data Push and Get" and the HTTP requests also contains this parameter, it will be based on the URL in the HTTP requests. | http://your_receive_url_address |
| register | boolean | No | If pass"true", it will be considered as the verification code SMS which is used for registration. This data will be included in the statistic registration success rate. Please contact with customer service team if necessary. | true |
Response:
JSON Representations:
{ "code": 0, "msg": "发送成功", "count": 1, "fee": 0.05, "unit": "RMB", "mobile": "13012312312", "sid": 16741236146 }
SDK Download
We provide SDKs to allow you to access with Yunpian APIs quickly according to your languages.
Response Parameter:
| PARAMETER | TYPE | DESCRIPION | EXAMPLE |
|---|---|---|---|
| code | integer | The status code of the SMS. SMS delivery information is reflected in message status. The possible values can be found in the" Return Code Description". | 0 |
| msg | string | The detailed status of the SMS. SMS delivery information is reflected in message status. The possible values can be found in the" Return Code Description". | "发送成功" |
| count | integer | SMS count | 1 |
| fee | double | Deduction Amount. One SMS can support 70 words. If the SMS is more than 70 words, will separate it per 67 words . | 0.05 |
| unit | string | Unit | "RMB" |
| mobile | string | Mobile number | "13200000000" |
| sid | long(64 bit) | SMS id | 16741236146 |

