本文整理自网络,侵删。
subscribeMessage.deleteTemplate
本接口应在服务器端调用,详细说明参见服务端API。 本接口支持云调用。需开发者工具版本 >= 1.02.1904090(最新稳定版下载)wx-server-sdk >= 0.4.0
删除帐号下的个人模板
调用方式:
- HTTPS 调用
- 云调用
HTTPS 调用
请求地址
POST https://api.weixin.qq.com/wxaapi/newtmpl/deltemplate?access_token=ACCESS_TOKEN
请求参数
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
access_token | string | 是 | 接口调用凭证 | |
priTmplId | string | 是 | 要删除的模板id |
返回的 JSON 数据包
属性 | 类型 | 说明 |
---|---|---|
errcode | number | 错误码 |
errmsg | string | 错误信息 |
请求示例
content-type: application/json;
{
"priTmplId": "wDYzYZVxobJivW9oMpSCpuvACOfJXQIoKUm0PY397Tc"
}
响应示例
{
"errmsg": "ok",
"errcode": 0
}
云调用
云调用是小程序·云开发提供的在云函数中调用微信开放接口的能力,需要在云函数中通过 wx-server-sdk 使用。接口方法
openapi.subscribeMessage.deleteTemplate
需在 config.json 中配置 subscribeMessage.deleteTemplate API 的权限,详情
请求参数
属性 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
priTmplId | string | 是 | 要删除的模板id |
请求示例
content-type: application/json;
const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.subscribeMessage.deleteTemplate({
priTmplId: 'wDYzYZVxobJivW9oMpSCpuvACOfJXQIoKUm0PY397Tc'
})
return result
} catch (err) {
return err
}
}
响应示例
const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.subscribeMessage.deleteTemplate({
errmsg: 'ok',
errcode: 0
})
return result
} catch (err) {
return err
}
}
标签:微信小程序
相关阅读 >>
微信小程序api 绘图globalcompositeoperation
微信小程序api 音频-inneraudiocontext对象
更多相关阅读请进入《微信小程序》频道 >>

Vue.js 设计与实现 基于Vue.js 3 深入解析Vue.js 设计细节
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者