- sendall?access_token={access_token}群发消息总是40001?
其他api调用都正常,包括上传图片,编辑草稿,普通发表都没问题,但是像下面调用群发消息时,总是提示: {'errcode': 40001, 'errmsg': 'invalid credential, access_token is invalid or not latest, could get access_token by getStableAccessToken, more details at https://mmbizurl.cn/s/JtxxFh33r rid: 66345fd5-6153510f-1dcf4a73'} 请问是怎么回事? url = "https://api.weixin.qq.com/cgi-bin/message/mass/sendall?access_token={access_token}" data = { "filter": { "is_to_all": True, }, "mpnews": { "media_id": draft_id }, "msgtype": "mpnews", "send_ignore_reprint": 1 } response = requests.post(url, json=data) # 解析响应结果 result = response.json()
05-03 - 群发消息sendall?access_token={access_token}总是返回40001?
url = f"https://api.weixin.qq.com/cgi-bin/freepublish/submit?access_token={access_token}" data = { "media_id": draft_id } response = requests.post(url, json=data) 像上面这样发表图文到订阅号可以发成功 但是像下面这样推送同样的图文给所有人就始终报错,{'errcode': 40001, 'errmsg': 'invalid credential, access_token is invalid or not latest, could get access_token by getStableAccessToken, more details at https://mmbizurl.cn/s/JtxxFh33r rid: 663376f6-43d5f8d6-61ed759b'} 请问: 1,同样的图文,发普通文章可以成功,说明access_token没错并且每次都是重新获取的。群发消息为什么总是返回40001? 1,是我的订阅号没权限群发API吗? 2,哪里出错了? url = "https://api.weixin.qq.com/cgi-bin/message/mass/sendall?access_token={access_token}" data = { "filter": { "is_to_all": True, }, "mpnews": { "media_id": draft_id }, "msgtype": "mpnews", "send_ignore_reprint": 1 } response = requests.post(url, json=data)
05-02