公众号发送图文消息(mpnews)报错40007;说明:invalid media_id
1、通过上传图文消息内的图片获取URL
2、上传永久素材
3、新建草稿 获取media_id 入参:
{
"title": "会员卡使用指南 | 轻松几步,教您如何到店享受服务!",
"digest": "为了让您的服务体验更加顺畅无阻,我们特别准备了这篇指南,详细为您解读“绑卡-预约-到店享受服务”的完整流程",
"content": "<section style=\"vertical-align: middle;display: inline-block;line-height: 0;width: 100%;height: auto;\"><img style=\"vertical-align: middle; width: 100% !important; height: auto !important; visibility: visible !important;\" src=\"http://mmbiz.qpic.cn/sz_mmbiz_jpg/BQUPyiaiadGOiaRpn3aubNuX6pQ3sqckPvmhqGAJgo77CQQdKMSYDFUovLlpQR420tdVcVLFBVxibxPrO0d3U1icGgQ/0?from=appmsg\" /></section>",
"thumbMediaId": "GCU2zn22xGokyNO9R0UfeX4S95AwWa3xSkgQr22lZmiup2MfZzgc-sHkfn4kCluM"
}
4、发布接口 出参:
{
"publish_id": "2247487596",
"errcode": 0,
"errorCodeValue": 0,
"errmsg": "ok",
"p2PData": null,
"hints": null
}
5、获取成功发布列表,获取article_id 出参:
{
"article_id": "qTGX-2l64YYDNi03o-_vtt3ITV6r64DUr7vAeE3PoNR_9kVM6R3tfDg5lL9P0qIN",
"content": {
"news_item": [
{
"is_deleted": false,
"url": "http://mp.weixin.qq.com/s?__biz=MzkyODUzMzI3NA==&mid=2247487596&idx=1&sn=72831679da6a38c7c79495734e7beb1d&chksm=c2160e19f561870ff8e50684d334c51234784445694cdc6cdad15f212f1b945d1a275cabee17#rd",
"title": "会员卡使用指南 | 轻松几步,教您如何到店享受服务!",
"author": "",
"digest": "为了让您的服务体验更加顺畅无阻,我们特别准备了这篇指南,详细为您解读“绑卡-预约-到店享受服务”的完整流程",
"content": "<section style=\"vertical-align: middle;display: inline-block;line-height: 0;width: 100%;height: auto;\"><img data-src=\"https://mmbiz.qpic.cn/sz_mmbiz_jpg/BQUPyiaiadGOiaRpn3aubNuX6pQ3sqckPvmhqGAJgo77CQQdKMSYDFUovLlpQR420tdVcVLFBVxibxPrO0d3U1icGgQ/640?from=appmsg\" style=\"vertical-align: middle; width: 100% !important; height: auto !important; visibility: visible !important;\"></section>",
"content_source_url": "",
"thumb_media_id": "GCU2zn22xGokyNO9R0UfeX4S95AwWa3xSkgQr22lZmiup2MfZzgc-sHkfn4kCluM",
"show_cover_pic": "0",
"need_open_comment": 0,
"only_fans_can_comment": 0
}
],
"errcode": 0,
"errorCodeValue": 0,
"errmsg": null,
"p2PData": null,
"hints": null
},
"update_time": 1712916986
}
6、发送图文消息
errcode:40007
errmsg:invalid media_id
rid: 66190a65-108143ca-6ad452ce
你好,请问是使用article_id 代替 media_id是吗?
官方的技术大大 回一个吧
按开发文档写的,前面一切顺利就是发送发表后的文章消息(mpnews)不成功。
把media_id改为草稿的media_id可以正常放送,只要发表后再通过发布状态轮询接口或获取成功发布列表拿到的article_id就报40007错误