新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)百度小程序教程:getTemplateList
- getTemplateList
getTemplateList
解釋:獲取帳號下已存在的模板列表。

GET https://openapi.baidu.com/rest/2.0/smartapp/template/templatelist
公共請求參數(shù):
| 參數(shù)名 | 類型 | 是否必須 | 描述 |
|---|---|---|---|
| access_token | String | 是 | access_token ,授權(quán)小程序的接口調(diào)用憑據(jù) |
請求參數(shù):
| 參數(shù)名 | 類型 | 是否必須 | 描述 |
|---|---|---|---|
| offset | Int | 是 | 用于分頁,表示從 offset 開始,默認(rèn)值為 0 |
| count | Int | 是 | 用于分頁,表示拉取 count 條記錄,默認(rèn)值為 0,最大為 20 |
公共響應(yīng)參數(shù)
| 參數(shù) | 類型 | 描述 | 示例值 |
|---|---|---|---|
| errno | Int | 狀態(tài)碼 | 40001 |
| msg | String | 狀態(tài)描述 | 參數(shù)錯誤 |
| data | Object | 響應(yīng)參數(shù) | — |
響應(yīng)參數(shù)
| 字段名 | 類型 | 描述 |
|---|---|---|
| total_count | Int | 模板庫標(biāo)題總數(shù) |
| template_id | String | 模板 id ,發(fā)送小程序模板消息時所需 |
| title | String | 模板標(biāo)題 |
| content | String | 模板內(nèi)容 |
| example | String | 模板內(nèi)容示例 |
請求示例
curl -X GET \'https://openapi.baidu.com/rest/2.0/smartapp/template/templatelist?access_token=24.ee3671b4e41f2704280d5ddbe9a3f94c.3600.1556461507.C8Bds396khnu6KDKnqfoUUgZ31K-hBY-gJNc4SsGGjYJrS2RMh&count=20&offset=2271'
響應(yīng)示例
{"errno": 0,"msg": "success","data": {"total_count": 2,"list": [{"template_id": "e4313219538c4b0262e3a14a0507000e8bd79e9PTPAz","title": "續(xù)費(fèi)成功通知","content": "購買時間{{keyword1.DATA}}\n物品名稱{{keyword2.DATA}}","example": "購買時間: 2016年6月6日\n物品名稱: 奶茶"},{"template_id": "f34178cd598201d9dc8d5c88cd87b44cf7cd0e64d90Y","title": "續(xù)費(fèi)成功通知","content": "購買時間{{keyword1.DATA}}\n物品名稱{{keyword2.DATA}}","example": "購買時間: 2016年6月6日\n物品名稱: 奶茶"}]}}
文章題目:創(chuàng)新互聯(lián)百度小程序教程:getTemplateList
文章轉(zhuǎn)載:http://www.5511xx.com/article/cochdjp.html


咨詢
建站咨詢
