查询小程序新建的订阅消息模板列表

更新时间 2024-07-26 09:23:35
收藏
我的收藏

接口说明

查询小程序新建的订阅消息模板列表。

前提条件

需要小程序已上线

使用限制

基本信息

名称描述
HTTP URL
https://open.douyin.com/api/notification/v2/subscription/query_created_tpl_list/
HTTP Method
GET
Scope
notification.openapi.common
权限要求

服务商代调用场景下,需商家授予服务商运营管理权限集:

请求头

名称字段类型是否必填示例描述
access-tokenString
当非服务商时,调用https://open.douyin.com/oauth/client_token/生成的token
当服务商时,调用https://open.douyin.com/api/tpapp/v2/auth/get_auth_token/生成的token
content-typeStringapplication/json
固定值"application/json"

请求参数

Query

名称字段类型是否必填示例描述
page_numInt321
分页编号,从1开始
page_sizeInt3210
分页大小,小于等于50

请求示例

curl --location --request GET 'https://open.douyin.com/api/notification/v2/subscription/query_created_tpl_list/?page_size=10&status=1&page_num=1' \
--header 'content-type: application/json' \
--header 'access-token: 0801121846735352506a356a6' 

响应参数

Body

名称字段类型是否必填示例描述
err_msgString

错误信息

err_noInt320

错误码,0 是成功,其它为异常

log_idString202008121419360101980821035705926A

标识请求的唯一id,在接口异常时用于问题排查

响应示例

正常响应示例

{
  "err_msg": "",
  "err_no": 0,
  "log_id": "202008121419360101980821035705926A",
  "data": {
    "total_count": 1,
    "template_list": [
      {
        "title": "xxxx",
        "keyword_list": [
          "xx",
          "xxx"
        ],
        "classification": 1,
        "host_list": [
          "toutiao",
          "douyin"
        ],
        "operating_time": 1672835937,
        "status": 1,
        "fail_reason": ""
      }
    ]
  }
}

异常响应示例

{
  "err_no": 28001038,
  "err_msg": "xx参数不合法",
  "log_id": "202008121419360101980821035705926A"
}

错误码

http状态码错误码错误码描述排查建议
20028001038
参数错误
按err_msg检查入参
20028014024
一次性模板和长期模板不能混用
20028014025
被禁止使用订阅通知功能
20028001005
服务内部错误
重试仍无效时提oncall
20028014028
只对抖音/抖音极速版/头条开放
20028014029
新手村权限拦截
20028014026
发送消息太频繁
20028014030
tpl_id不合法
20028014027
存在敏感内容