May 20, 2021 WeChat Mini Program Development Document
This interface should be called on the server side, as detailed in the Service Side API.
This interface supports cloud calls. Developer tool version required . . . 1.02.1904090 (latest stable download)
wx-server-sdk >= 0.4.0
Delete the personal template under your account
How to call:
POST https://api.weixin.qq.com/wxaapi/newtmpl/deltemplate?access_token=ACCESS_TOKEN
Property | Type | The default | Required | Description |
---|---|---|---|---|
access_token | string | Is | The interface calls the credentials | |
priTmplId | string | Is | The template id to delete |
Property | Type | Description |
---|---|---|
errcode | number | Error code |
errmsg | string | The error message |
content-type: application/json;
{
"priTmplId": "wDYzYZVxobJivW9oMpSCpuvACOfJXQIoKUm0PY397Tc"
}
{
"errmsg": "ok",
"errcode": 0
}
Cloud call is the ability provided by the small program Cloud Development to call WeChat open interfaces in cloud functions and need to be used in cloud functions via wx-server-sdk.
openapi.subscribeMessage.deleteTemplate
Permissions for the subscribeMessage.deleteTemplate API need to be configured in config.json, details
Property | Type | The default | Required | Description |
---|---|---|---|---|
priTmplId | string | Is | The template id to delete |
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
}
}