查询超级短信模板
HTTP 头信息:
Accept:application/json;charset=utf-8; Content-Type:application/x-www-form-urlencoded;charset=utf-8;
请求
URL:https://vsms.yunpian.com/v2/vsms/get_tpl.json 访问方式:POST
特别说明 该功能需联系在线客服开通。
请求参数
参数名 | 类型 | 是否必传 | 是否默认开放 | 描述 | 示例 |
apikey | string | 是 | 是 | 用户唯一标识,在"账号设置"-"子帐号管理"中查看 | 9b11127a9701975c 734b8aee81ee3526 |
tpl_id | string | 是 | 是 | 模版 id | 126 |
请求示例
php:
$ch = curl_init(); $apikey = "xxxxxxxxx"; //修改为您的apikey(https://www.yunpian.com)登录官网后获取 //你后台审核通过的模板id $tpl_id = 123; $ch = curl_init(); $data=array('apikey'=> $apikey,'tpl_id'=> $tpl_id); curl_setopt($ch, CURLOPT_URL, 'https://vsms.yunpian.com/v2/vsms/get_tpl.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);
响应
名称 | 类型 | 描述 |
code | integer | 0 代表请求成功 |
msg | string | code 描述 |
tpl_id | string | 模板 id |
check_status | string | 审核状态(PENDING, CHECKING, SUCCESS, FAIL,EXPIRED) |
expire_time | string | 模板失效时间,格式为yyyy-MM-dd HH:mm:ss |
reason | string | 审核批注 |
yd_enabled | string | 此模板是否可发移动号码 |
lt_enabled | string | 此模板是否可发联调号码 |
dx_enabled | string | 此模板是否可发电信号码 |
Json 返回示例
{ "code": 0, "msg": "OK", "data": { "tpl_id": 126, "check_status": "SUCCESS", "expire_time": "2020-08-06 12:12:12" "reason": null, "yd_enabled": true, "lt_enabled": true, "dx_enabled": false } }