微信开发模板消息推送,回复错误代码48001?

小程序 文章 2022-02-16 11:40 3246 0 全屏看文

AI助手支持GPT4.0

微信开发模板消息推送,回复错误代码48001?WeChat development template message push, reply error code 48001?

微信开发模板消息推送,回复错误代码48001?

发送微信模板消息,模板权限已获得,使用后台python编写发送程序,本地测试,小程序已经注册,可以获得access_token,发送后回复内容为:"errcode":48001,"errmsg":"api unauthorized rid: 620c59ff-25d1138a-55bce6a3"

代码如下url = 'https://api.weixin.qq.com/cgi-bin/message/template/send'params = {    'access_token': access_token,    'data': {        "touser": "xxxxxxxxxxxx",        "template_id": "WLSiIt0f0H5WwNILmcf3gY9aADrhjQJ1pJWaHKmz0ZA",        "url": "http://weixin.qq.com/download",        "topcolor": "#FF0000",        "data": {            "first": {   "value": "您的设备已触发温度报警。",   "color": "#173177"            },        "keyword1": {            "value": "1222032091",            "color": "#173177"        },        "keyword2": {            "value": "温湿度恒温箱",            "color": "#173177"        },        "keyword3": {            "value": "2021年06月07日19时24分",            "color": "#173177"        },        "keyword4": {            "value": "温度超标 45°C",            "color": "#173177"        },        "remark": {            "value": "06月07日19时24分",            "color": "#173177"        }    },}}response = requests.post(url=url, params=params)



When sending wechat template messages, the template permission has been obtained. The sending program is written in background python, tested locally, and the applet has been registered to obtain access_ After sending, the reply content is: "errCode": 48001, "errmsg": "API unauthorized rid: 620c59ff-25d1138a-55bce6a3". The code is as follows url = ' https://api.weixin.qq.com/cgi-bin/message/template/send 'params = { 'access_token': access_token, 'data': { "touser": "xxxxxxxxxxxx", "template_id": "WLSiIt0f0H5WwNILmcf3gY9aADrhjQJ1pJWaHKmz0ZA", "url": " http://weixin.qq.com/download "," Topcolor ":" #ff0000 "," data ": {" first ": {" value ":" your device has triggered a temperature alarm. "," color ":" #173177 "}," keyword1 ": {" value ":" 1222032091 "," color ":" #173177 "}," keyword2 ": {" value ":" thermostat "," color ":" #173177 "}," keyword3 ": {" value ":" 19:24 on June 7, 2021 "," color ":" #173177 "}," keyword4 ": {" value ":" the temperature exceeds 45 ° C "," color ":" #173177 "}," remark ": {" value ":" 19:24 on June 7 "," color ":" #173177 "} " } },}}response = requests.post(url=url, params=params)

回答:

社区技术运营专员-horanzhou:

你好,

详情请参考:https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Global_Return_Code.html


许先森:

小程序的发送消息的api也不是你调用的这个url呀

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
今天(2021.12.9)调用图片鉴黄接口一直失败,是微信这边服务爆掉了吗?
HBuilder X运行微信小程序至微信开发者工具失败(路径正确,端口开了)?
我想更改管理者,需要新管理者和旧管理者用同一台电脑扫码吗?
公众号发布了两百多个原创视频(均大于一分钟),却没有一点点的推荐流量,全是0推荐,这是什么原因?
canvas组件在pc上不支持吗?
随便看看
教育科技公司申请微信支付被拒绝? 3956
微信公众号免300认证教程 5072
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 4384
小程序广告组件通过审核,但是小程序内没有显示广告? 4357
企业微信通讯录账号被管理员误/恶意删除,怎么办? 8381
问题? 7595
如何快速搭建抽奖助手小程序(无需代码知识) 5171
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 6337
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 5745
我的小程序广告收款主体是个体工商户,每个月邮寄两次发票很是麻烦,我年底的时候打包邮寄一次可以么? 5312