- 批量发送视频短信
- 请求
- 请求参数
- 请求示例
- php:
- 响应
- Json返回示例
批量发送视频短信
HTTP头信息:
Accept:application/json;charset=utf-8;Content-Type:application/x-www-form-urlencoded;charset=utf-8;
请求
URL:https://vsms.yunpian.com/v2/vsms/tpl_batch_send.json
访问方式:POST
特别说明 该功能需联系在线客服开通。
说明
如需状态报告,请参考如下方式。
获取状态报告
推送状态报告
请求参数
| 参数名 | 类型 | 是否必传 | 是否默认开放 | 描述 | 示例 |
|---|---|---|---|---|---|
| apikey | string | 是 | 是 | 用户唯一标识,在管理控制台获取 | 9b11127a9701975c734b8aee81ee3526 |
| tpl_id | string | 是 | 是 | 模版id | 126 |
| mobile | string | 是 | 是 | 手机号,多个号码用英文逗号,分隔,限制1000个 | 单号码:15205201314 多号码:15205201314,15205201315 |
| uid | string | 否 | 否 | 用户自定义的uid,默认不开放,请联系客服开通 | 9b11127a9701975c |
请求示例
php:
<?php$ch = curl_init();$apikey = "xxxxxxxxx"; //修改为您的apikey(https://www.yunpian.com)登录官网后获取//你后台审核通过的模板id$tpl_id = 123;//单个号码$mobile = "18800000000";//多个号码//$mobile = "18800001111,18800002222";$ch = curl_init();$data=array('apikey'=> $apikey,'tpl_id'=> $tpl_id,'mobile'=> $mobile);curl_setopt($ch, CURLOPT_URL, 'https://vsms.yunpian.com/v2/vsms/tpl_batch_send.json');curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);$json_data = curl_exec($ch);var_dump($json_data);//解析返回结果(json格式字符串)$array = json_decode($json_data,true);print_r($array);
响应
| 名称 | 类型 | 描述 |
|---|---|---|
| total_count | integer | 总发送条数 |
| total_fee | string | 扣费金额,单位:元,类型:双精度浮点型/double |
| unit | string | 计费单位;例如:“RMB” |
| data | json | json |
| code | string | 0代表请求成功 |
| count | integer | 条数 |
| fee | string | 计费 |
| mobile | string | 手机号 |
| msg | string | code描述 |
| sid | string | 唯一编码 |
Json返回示例
{"total_count": 28,"total_fee": "9.8000","unit": "RMB","data":[{"code": 0,"count": 1,"fee": 0.35,"mobile": "13101234567","msg": "发送成功","sid": 20573912666,"unit": "RMB"},{"code": 0,"count": 1,"fee": 0.35,"mobile": "130612345677","msg": "发送成功","sid": 20573912664,"unit": "RMB"}]}
