公众号模板消息偶现invalid template_id错误
发布于 6 年前 作者 bchen 11632 次浏览 来自 问答

比如1分钟内,给100个用户各发送一条公众号模板消息,偶尔会出现1条消息发送失败,返回invalid template_id错误,而其它消息发送正常的情况。

仔细核对过appid和template_id是对应的,并且是使用公众号appid发送(并不是小程序appid)。

问题是偶现,比较随机,已持续数月。这个模板消息接口是不是有bug?期待官方解答!

公众号appid:

wx7145c571b99a8368

公众号绑定的小程序appid:

wxee55405953922c86

公众号绑定的模板id:

84R0_5SzbUvQEhoh5o6XSlasgGNlG8Vgjhy-mGPG90Y

使用公众号发送模板消息,跳转小程序,请求api:

https://api.weixin.qq.com/cgi-bin/message/template/send

请求数据:

{'miniprogram': {'pagepath': 'pages/detail/detail?cid=5ba4ade463426d215d047c54', 'appid': 'wxee55405953922c86'}, 'data': {'remark': {'color': '', 'value': u'\n\u5982\u679c\u4e0d\u60f3\u63a5\u53d7\u63a8\u9001\uff0c\u53ef\u4ee5\u5728\u7b7e\u5230\u300c\u8bbe\u7f6e\u300d\u4e2d\u5173\u95ed\u8be5\u63d0\u9192\uff0c\u6216\u76f4\u63a5\u56de\u590d\u300cTD#368150\u300d\u9000\u8ba2\u63d0\u9192'}, 'keyword3': {'color': '#0089ff', 'value': u'\u5df2\u62a5\u540d'}, 'keyword2': {'color': '#0089ff', 'value': u'2018/09/21-\u6c38\u4e45'}, 'keyword1': {'color': '#e33431', 'value': u'\u4e002\u73ed\u6570\u5b66\u4f5c\u4e1a\u7b7e\u5230\u5361'}, 'first': {'color': '', 'value': u'\u4f60\u8bbe\u7f6e\u7684\u63d0\u9192\u65f6\u95f4\u5230\u4e86\uff0c<\u70b9\u51fb\u5361\u7247\u53bb\u7b7e\u5230>\n'}, 'keyword5': {'color': '#0089ff', 'value': '07:00-22:00'}, 'keyword4': {'color': '#0089ff', 'value': u'\u603b\u6392\u540d\u7b2c22\u540d\uff0c\u517164\u4eba\u53c2\u4e0e'}}, 'touser': u'o9OiW0h3R8f2XaLQl6fMiy5GYoeU', 'template_id': '84R0_5SzbUvQEhoh5o6XSlasgGNlG8Vgjhy-mGPG90Y'}

返回数据:

{'errcode': 40037, 'errmsg': 'invalid template_id hint: [4sjz0a04223933]'}

在后台可查看到模板id是正常绑定状态,并可以继续正常发送消息

1 回复

提供下失败的template_id

回到顶部