其他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()
你好,日志查看:request: access_token=%7Baccess_token%7D
注意:access_token=token,这里的token是指通过接口获取的token。麻烦参考下文档:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/getStableAccessToken.html
是不是新注册公众号,即使认证了也要过几天才有权限调用群发接口
同问,大佬问题解决后教教我哈