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)
用postman看看