获取模板


HTTP头信息:


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


请求


URL:https://sms.yunpian.com/v2/tpl/get.json


注意:海外服务器地址 us.yunpian.com


访问方式:POST


请求参数

参数名

类型

是否必须

描述

示例

apikey

string

用户唯一标识,在账号设置-子帐号管理中查看

9b11127a9701975c734b8aee81ee3526

tpl_id

long

模板id,64位长整形。指定id时返回id对应的 模板。未指定时返回所有模板

1


响应

名称

类型

描述

tpl_id

int

模板id

tpl_content

string

模板内容

tpl_variable

array

变量集合,详见下方变量结构说明

check_status

string

//审核状态:CHECKING/SUCCESS/FAIL

reason

string

审核未通过的原因

country_code

string

支持国家及地区,国内模板该值为null

tpl_variable 参数说明

参数名

类型

描述

variable

string

变量

variableType

integer

变量类型值: 见变量类型表

paramValueExample

string

参数示例

变量类型表

变量类型值

变量类型含义

1

验证码

2

其他号码

3

用户昵称

4

个人姓名

5

地址

7

金额

8

链接

9

时间

10

其他


指定id时,调用成功的返回值示例:

{
  "tpl_id": 1,
  "tpl_content": "您的验证码是#code#",
  "tpl_variable": [
    {
      "variable": "code",
      "variableType": 8,
      "paramValueExample": "https://www.yunpian.com"
    }
  ],
  "check_status": "FAIL",
  "reason": "模板开头必须带签名,如【云片网络】",
  "ref_id": null
}

未指定id时,调用成功的返回值示例:

[
  {
    "tpl_id": 1234,
    "tpl_content": "您的验证码是#code#",
    "tpl_ariable": [
      {
        "variable": "code",
        "variableType": 4
      }
    ],
    "check_status": "FAIL",
    "reason ": "模板开头必须带签名,如【云片网】",
    "lang": null,
    "country_code": null
  },
  {
    "tpl_id": 2345,
    "tpl_content": "【云片网】您的验证码是#code#。如非本人操作,请忽略本短信",
    "tpl_variable": [
      {
        "variable": "code",
        "variableType": 8,
        "paramValueExample": "https://www.yunpian.com"
      }
    ],
    "check_status": "SUCCESS",
    "reason ": null,
    "lang": null,
    "country_code": null
  }
]