用户以订阅
openID:oHKvd5NmE2N4neriu4SK0OXr--c4 appID:wxa99d42c79443152f
errMsg: "requestSubscribeDeviceMessage:ok"
ibAZlJG2v9QiVAYvdfQfMkG34YGgBz57IWYdS30Y10E: "accept"
oVl2EnjmdRFavBuixFYWTx-ApY1SIJlTonssAFR4g3I: "accept"
wxaapi/newtmpl/gettemplate 通过API获取的长期订阅模板
"data": [
{
"priTmplId": "ibAZlJG2v9QiVAYvdfQfMkG34YGgBz57IWYdS30Y10E",
"title": "门锁异常提醒",
"content": "提醒时间:{{time1.DATA}}\n提示说明:{{enum_string2.DATA}}\n",
"example": "提醒时间:2022年4月6日 12:00:00\n提示说明:门锁发生异常,请注意查看。\n",
"type": 3,
"keywordEnumValueList": [
{
"enumValueList": [
"门锁发生异常,请注意查看。"
],
"keywordCode": "enum_string2.DATA"
}
]
},
{
"priTmplId": "oVl2EnjmdRFavBuixFYWTx-ApY1SIJlTonssAFR4g3I",
"title": "门铃呼叫提醒",
"content": "呼叫时间:{{time1.DATA}}\n提示说明:{{enum_string2.DATA}}\n",
"example": "呼叫时间:2022年4月11日 12:00\n提示说明:访客呼叫门铃,请注意查看\n",
"type": 3,
"keywordEnumValueList": [
{
"enumValueList": [
"访客呼叫门铃,请注意查看"
],
"keywordCode": "enum_string2.DATA"
}
]
}
],
"errmsg": "ok",
"errcode": 0
cgi-bin/message/subscribe/send
提交参数
"touser": "oHKvd5NmE2N4neriu4SK0OXr--c4",
"template_id": "oVl2EnjmdRFavBuixFYWTx-ApY1SIJlTonssAFR4g3I",
"page": "pages/index/index",
"miniprogram_state": "trial", // formal 生产环境返回一样错误
"data": {
"time01": {
"value": "2023-09-26 12:04:09"
},
"enum_string02": {
"value": "你的设备“d4f98d62107e”有新的开锁请求!"
}
}
响应
"errcode": 40037,
"errmsg": "invalid template_id rid: 6512591d-04ed81b7-1f9015fd"