接口描述:

  • 获取通知系统模板列表。

请求 URL:

  • http|https://host/api/v1/notice_tpl/method/get.notice.tpl.list/

请求方式:

  • GET
  • POST

是否授权:

  • 需要授权

业务参数:

参数名 类型 是否必须 范围值 默认值 示例值 描述
code string in:sms,email email 通知系统编码 sms=短信 email=邮件

响应参数:

参数名 类型 是否返回 示例值 描述
status integer 200 状态码
message string success 消息信息
data array [] 返回数组
data 类型 是否返回 示例值 描述
notice_tpl_id integer 8 通知系统模板编号
name string 通用验证 通知系统模板名称
code string email 通知系统编码 sms=短信 email=邮件
type integer 0 通知类型,详见「Type常量」
sms_code string SMS_126357840 阿里云短信模板编号
title string 欧瑞 标题或签名
template string {验证码} 通知系统模板
status integer 1 模板是否启用 0=禁用 1=启用
get_notice_item array [] 通知系统可用变量数组
get_notice_item 类型 是否返回 示例值 描述
item_name string {验证码} 可用变量名称
replace_name string number 可用变量

响应示例:

  1. {
  2. "status": 200,
  3. "message": "success",
  4. "data": [
  5. {
  6. "notice_tpl_id": 8,
  7. "name": "通用验证",
  8. "code": "email",
  9. "type": 0,
  10. "sms_code": "",
  11. "title": "收取验证码",
  12. "template": "您的验证码是{验证码},在5分钟内有效。如非本人操作请忽略本信息。",
  13. "status": 1,
  14. "get_notice_item": [
  15. {
  16. "item_name": "{验证码}",
  17. "replace_name": "number"
  18. }
  19. ]
  20. },
  21. {
  22. "notice_tpl_id": 9,
  23. "name": "注册成功",
  24. "code": "email",
  25. "type": 1,
  26. "sms_code": "",
  27. "title": "",
  28. "template": "",
  29. "status": 1,
  30. "get_notice_item": [
  31. {
  32. "item_name": "{商城名称}",
  33. "replace_name": "shop_name"
  34. },
  35. {
  36. "item_name": "{用户账号}",
  37. "replace_name": "user_name"
  38. },
  39. {
  40. "item_name": "{用户昵称}",
  41. "replace_name": "nick_name"
  42. }
  43. ]
  44. },
  45. {
  46. "notice_tpl_id": 10,
  47. "name": "充值成功",
  48. "code": "email",
  49. "type": 2,
  50. "sms_code": "",
  51. "title": "",
  52. "template": "",
  53. "status": 1,
  54. "get_notice_item": [
  55. {
  56. "item_name": "{商城名称}",
  57. "replace_name": "shop_name"
  58. },
  59. {
  60. "item_name": "{用户账号}",
  61. "replace_name": "user_name"
  62. },
  63. {
  64. "item_name": "{用户昵称}",
  65. "replace_name": "nick_name"
  66. },
  67. {
  68. "item_name": "{充值金额}",
  69. "replace_name": "recharge_money"
  70. }
  71. ]
  72. },
  73. {
  74. "notice_tpl_id": 11,
  75. "name": "确认订单",
  76. "code": "email",
  77. "type": 3,
  78. "sms_code": "",
  79. "title": "",
  80. "template": "",
  81. "status": 1,
  82. "get_notice_item": [
  83. {
  84. "item_name": "{商城名称}",
  85. "replace_name": "shop_name"
  86. },
  87. {
  88. "item_name": "{用户账号}",
  89. "replace_name": "user_name"
  90. },
  91. {
  92. "item_name": "{用户昵称}",
  93. "replace_name": "nick_name"
  94. },
  95. {
  96. "item_name": "{主订单号}",
  97. "replace_name": "order_no"
  98. },
  99. {
  100. "item_name": "{订单金额}",
  101. "replace_name": "order_money"
  102. }
  103. ]
  104. },
  105. {
  106. "notice_tpl_id": 12,
  107. "name": "付款成功",
  108. "code": "email",
  109. "type": 4,
  110. "sms_code": "",
  111. "title": "",
  112. "template": "",
  113. "status": 1,
  114. "get_notice_item": [
  115. {
  116. "item_name": "{商城名称}",
  117. "replace_name": "shop_name"
  118. },
  119. {
  120. "item_name": "{用户账号}",
  121. "replace_name": "user_name"
  122. },
  123. {
  124. "item_name": "{用户昵称}",
  125. "replace_name": "nick_name"
  126. },
  127. {
  128. "item_name": "{主订单号}",
  129. "replace_name": "order_no"
  130. },
  131. {
  132. "item_name": "{订单金额}",
  133. "replace_name": "order_money"
  134. },
  135. {
  136. "item_name": "{商品金额}",
  137. "replace_name": "goods_money"
  138. }
  139. ]
  140. },
  141. {
  142. "notice_tpl_id": 13,
  143. "name": "下单成功",
  144. "code": "email",
  145. "type": 5,
  146. "sms_code": "",
  147. "title": "",
  148. "template": "",
  149. "status": 1,
  150. "get_notice_item": [
  151. {
  152. "item_name": "{商城名称}",
  153. "replace_name": "shop_name"
  154. },
  155. {
  156. "item_name": "{用户账号}",
  157. "replace_name": "user_name"
  158. },
  159. {
  160. "item_name": "{用户昵称}",
  161. "replace_name": "nick_name"
  162. },
  163. {
  164. "item_name": "{主订单号}",
  165. "replace_name": "order_no"
  166. },
  167. {
  168. "item_name": "{订单金额}",
  169. "replace_name": "order_money"
  170. },
  171. {
  172. "item_name": "{商品金额}",
  173. "replace_name": "goods_money"
  174. }
  175. ]
  176. },
  177. {
  178. "notice_tpl_id": 14,
  179. "name": "订单发货",
  180. "code": "email",
  181. "type": 6,
  182. "sms_code": "",
  183. "title": "",
  184. "template": "",
  185. "status": 1,
  186. "get_notice_item": [
  187. {
  188. "item_name": "{商城名称}",
  189. "replace_name": "shop_name"
  190. },
  191. {
  192. "item_name": "{用户账号}",
  193. "replace_name": "user_name"
  194. },
  195. {
  196. "item_name": "{用户昵称}",
  197. "replace_name": "nick_name"
  198. },
  199. {
  200. "item_name": "{主订单号}",
  201. "replace_name": "order_no"
  202. },
  203. {
  204. "item_name": "{订单金额}",
  205. "replace_name": "order_money"
  206. },
  207. {
  208. "item_name": "{商品金额}",
  209. "replace_name": "goods_money"
  210. },
  211. {
  212. "item_name": "{商品名称}",
  213. "replace_name": "goods_name"
  214. },
  215. {
  216. "item_name": "{快递公司}",
  217. "replace_name": "delivery_name"
  218. },
  219. {
  220. "item_name": "{快递单号}",
  221. "replace_name": "logistic_code"
  222. }
  223. ]
  224. }
  225. ]
  226. }

备注:

  1. 短信与邮件共用同一个结构,所以返回时存在多余字段则按需索取。

  2. 返回字段code值为sms时,字段title表示短信签名,否则表示邮件标题。

文档更新时间: 2018-06-06 02:13