ylbtech-微信-小程序-开发文档-服务端-模板消息:templateMessage.getTemplateLibraryById
1.返回顶部
1、

templateMessage.getTemplateLibraryById

本接口应在服务器端调用,详细说明参见服务端API

本接口支持云调用。需开发者工具版本 >= 1.02.1904090(最新稳定版下载),wx-server-sdk >= 0.4.0

获取模板库某个模板标题下关键词库

调用方式:

HTTPS 调用

请求地址

POST https://api.weixin.qq.com/cgi-bin/wxopen/template/library/get?access_token=ACCESS_TOKEN

请求参数

属性 类型 默认值 必填 说明
access_token string   接口调用凭证
id string   模板标题id,可通过接口获取,也可登录小程序后台查看获取

返回值

Object

返回的 JSON 数据包

属性 类型 说明
errcode number 错误码
errmsg string 错误信息
id string 模板标题 id
title string 模板标题
keyword_list Array.<Object> 关键词列表

keyword_list 的结构

属性 类型 说明
keyword_id string 关键词 id,添加模板时需要
name string 关键词内容
example string 关键词内容对应的示例

请求数据示例

{
"id": "AT0002"
}

返回数据示例

{
"errcode": 0,
"errmsg": "ok",
"id": "AT0002",
"title": "购买成功通知",
"keyword_list": [
{
"keyword_id": 3,
"name": "购买地点",
"example": "TIT造舰厂"
},
{
"keyword_id": 4,
"name": "购买时间",
"example": "2016年6月6日"
},
{
"keyword_id": 5,
"name": "物品名称",
"example": "咖啡"
}
]
}

云调用

云调用是小程序·云开发提供的在云函数中调用微信开放接口的能力,需要在云函数中通过 wx-server-sdk 使用。

接口方法

openapi.templateMessage.getTemplateLibraryById

需在 config.json 中配置 templateMessage.getTemplateLibraryById API 的权限,详情

请求参数

属性 类型 默认值 必填 说明
id string   模板标题id,可通过接口获取,也可登录小程序后台查看获取

返回值

Object

返回的 JSON 数据包

属性 类型 说明
errCode number 错误码
errMsg string 错误信息
id string 模板标题 id
title string 模板标题
keywordList Array.<Object> 关键词列表

keywordList 的结构

属性 类型 说明
keywordId string 关键词 id,添加模板时需要
name string 关键词内容
example string 关键词内容对应的示例

异常

Object

抛出的异常

属性 类型 说明
errCode number 错误码
errMsg string 错误信息

errCode 的合法值

说明 最低版本

请求数据示例

const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.templateMessage.getTemplateLibraryById({
id: 'AT0002'
})
console.log(result)
return result
} catch (err) {
console.log(err)
return err
}
}

返回数据示例

{
"errCode": 0,
"errMsg": "openapi.templateMessage.getTemplateLibraryById:ok",
"id": "AT0002",
"title": "购买成功通知",
"keywordList": [
{
"name": "购买地点",
"example": "TIT造舰厂",
"keywordId": 3
},
{
"name": "购买时间",
"example": "2016年6月6日",
"keywordId": 4
},
{
"name": "物品名称",
"example": "咖啡",
"keywordId": 5
}
]
}
2、
2.返回顶部
 
3.返回顶部
 
4.返回顶部
 
5.返回顶部
1、
2、
 
6.返回顶部
 
作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

微信-小程序-开发文档-服务端-模板消息:templateMessage.getTemplateLibraryById的更多相关文章

  1. 微信-小程序-开发文档-服务端-模板消息:templateMessage.send

    ylbtech-微信-小程序-开发文档-服务端-模板消息:templateMessage.send 1.返回顶部 1. templateMessage.send 本接口应在服务器端调用,详细说明参见服 ...

  2. 微信-小程序-开发文档-服务端-模板消息:templateMessage.getTemplateList

    ylbtech-微信-小程序-开发文档-服务端-模板消息:templateMessage.getTemplateList 1.返回顶部 1. templateMessage.getTemplateLi ...

  3. 微信-小程序-开发文档-服务端-模板消息:templateMessage.getTemplateLibraryList

    ylbtech-微信-小程序-开发文档-服务端-模板消息:templateMessage.getTemplateLibraryList 1.返回顶部 1. templateMessage.getTem ...

  4. 微信-小程序-开发文档-服务端-模板消息:templateMessage.deleteTemplate

    ylbtech-微信-小程序-开发文档-服务端-模板消息:templateMessage.deleteTemplate 1.返回顶部 1. templateMessage.deleteTemplate ...

  5. 微信-小程序-开发文档-服务端-模板消息:templateMessage.addTemplate

    ylbtech-微信-小程序-开发文档-服务端-模板消息:templateMessage.addTemplate 1.返回顶部 1. templateMessage.addTemplate 本接口应在 ...

  6. 微信-小程序-开发文档-服务端-接口调用凭证:auth.getAccessToken

    ylbtech-微信-小程序-开发文档-服务端-接口调用凭证:auth.getAccessToken 1.返回顶部 1. auth.getAccessToken 本接口应在服务器端调用,详细说明参见服 ...

  7. 微信小程序开发之formId使用(模板消息)

    基于微信小程序的模板消息:基于微信的通知渠道,我们为开发者提供了可以高效触达用户的模板消息能力,以便实现服务的闭环并提供更佳的体验.模板推送位置:服务通知模板下发条件:用户本人在微信体系内与页面有交互 ...

  8. 微信小程序 开发文档

    官方开发文档: 小程序公众平台 小程序开发者指南 小程序开发者文档 学习资源: 微信:官方入门教程 微信:WeUI 是一套同微信原生视觉体验一致的基础样式库 微信:微信小程序示例 视频: 学堂在线:学 ...

  9. 周六搞事情,微信小程序开发文档已放出!

    程序员们,你们有事干了! 个人感觉不管是什么形式的UI技术,都无法决定一个产品的生死,核心还是服务和模式的创新. 某些方面和ApiCloud好像,但发展前景远远胜过ApiCloud. 微信小程序可以为 ...

随机推荐

  1. Delphi 类(TObject、TPersistent、TComponent、TControl、TWinControl、TCustomControl、TGraphicControl、TInterfacedObject)简单介绍

      TObject:    VCL中所有类的根类,即是说:VCL中所有的类/组件/控件都是从TObject中继承而来.TObject类中定义了基本的 构造方法和析构方法.   TPersistent: ...

  2. php-异步上传插件

    http://www.cnblogs.com/kissdodog/archive/2012/12/15/2819025.html

  3. thinkphp整合后台模板

    将后台模板源码dist文件夹中的所有文件移动到thinkphp view index中 thinkphp的资源文件都不是从view文件夹下读取的 因此需要资源文件asset文件夹和demo文件夹放到t ...

  4. Python 生成json文件

    1.数据准备 数据下载 2.python代码 import datetime import os import mssqlhelper ms = mssqlhelper.MSSQL(host=&quo ...

  5. noip1998 提高组t3 挖地雷

    题目背景 NOIp1996提高组第三题 题目描述 在一个地图上有N个地窖(N<=20),每个地窖中埋有一定数量的地雷.同时,给出地窖之间的连接路径.当地窖及其连接的数据给出之后,某人可以从任一处 ...

  6. Golang 标准库提供的Log(一)

      原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://gotaly.blog.51cto.com/8861157/1405754 G ...

  7. Django+paramiko实现webshell

    说明 基于 python3.7 + django 2.2.3 实现的 django-webshell,支持颜色显示,支持 tab 命令补全,项目地址:https://github.com/leffss ...

  8. Amazon Linux AMI 2015.09 (HVM)平台搭建lamp

    更新yum yum update 安装Apache: yum install -y httpd 安装完之后,重新启动 service httpd restart 将Apache设置为开机启动 chkc ...

  9. Linux Kernel Development有关内存管理

    1 Pages Page的概念来源为处理器Processor的部件MMU(Memory Management Unit),MMU通过设置好的页表(通过设置CR3寄存器,指向页目录所在的物理内存)对内存 ...

  10. uboot刷机

    ath> tftp xx.zpk Trying eth0 Using eth0 device TFTP from server 192.168.1.104; our IP address is ...