添加模版

HTTP 头信息:

  1. Accept:application/json;charset=utf-8;
  2. Content-Type:application/x-www-form-urlencoded;charset=utf-8;

请求

URL:`https://sms.yunpian.com/v2/tpl/add.json`
注意:海外服务器地址 us.yunpian.com
访问方式:POST

请求参数

参数名 类型 是否必须 描述 示例
apikey string 用户唯一标识,在”账号设置”-“子帐号管理”中查看 9b11127a9701975c734b8aee81ee3526
tpl_content string 模板内容。当region参数传入global时,模板必须以带符号【】的签名开头 【云片网】您的验证码是#code#
region string 国际模板可发地区。其中:
abroad:除中国大陆外的国家及地区;
global:全球。
abroad
tpl_type integer 1 代表验证码类模板。当region为global且模板类型为验证码类模板时,此参数必传1 1
website string 验证码类模板对应的注册页面网址 https://www.yunpian.com/entry?method=register
lang
(已过期,请使用region)
string 国际短信模板所需参数,模板语言:简体中文 zh_cn;英文 en; 繁体中文 zh_tw; 韩文 ko,日文 ja; 其他语言 other (其他语言功能需联系在线客服开通) zh_cn
notify_type integer 审核结果短信通知的方式。其中:
0 表示需要通知,默认;
1 表示仅审核不通过时通知;
2 表示仅审核通过时通知;
3 表示不需要通知;
1
callback string 审核结果会向这个地址推送,推送参数如下 ``http://your_receive_url_address

callback 推送参数举例

名称 类型 描述
tpl_id string 模板 id
tpl_content string 模板内容
check_status string //审核状态:CHECKING/SUCCESS/FAIL
reason string 审核未通过的原因

响应

名称 类型 描述
tpl_id string 模板 id
tpl_content string 模板内容
check_status string //审核状态:CHECKING/SUCCESS/FAIL
reason string 审核未通过的原因
country_code string 支持地区

Json 返回值示例(国际短信模板):

{
    "tpl_id": 3614732,
    "tpl_content": "【Yunpian】your verification code is 1234",
    "check_status": "CHECKING",
    "reason": null,
    "lang": null,
    "country_code": "abroad"
}