1. 上传临时素材 图片
https://api.weixin.qq.com/cgi-bin/media/upload?access_token=
返回结果为:
{"type":"image","media_id":"AYaWswY9MWll2mJXZyoept3bZY9sJ05QeudIfA50A0bION4acOies-0lvdLgR9Xh","created_at":1601262611,"item":[]}
这个结果与文档内https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/customer-message/customerServiceMessage.uploadTempMedia.html 返回示例并不一致. 多了item 少了errormsg与errorcode.
2. 验证临时素材是否上传成功. 通过获取素材接口来测试是否成功
https://api.weixin.qq.com/cgi-bin/media/get?access_token=
结果是可以下载到图片素材
3. 发送客服消息 传media_id 返回结果一直是错误40007
接口https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=
{"errcode":40007,"errmsg":"invalid media_id rid: 5f715414-7b876433-66d423e5"}
请问是哪里出了问题? 文字消息正常.
补充appId: wxbb210eb550cd8c29 openId:oy-xJ5DzfpJm-chEUjdiUSGmSvrc 时间大概在:2020年9月28日 上午 10:35~11:35
经查,rid=5f715414-7b876433-66d423e5,传入的json为:
{"image":{"mediaId":"AYaW****R9Xh"},"touser":"oy-***vrc","msgtype":"image"}
可以看到,是image.media_id字段写错了。文档要求是media_id,你传入的是mediaId。
先参考下这里的回复:客服消息推送图片失败? 娇华 的回答 - 微信开放社区 https://developers.weixin.qq.com/community/develop/doc/00002cde83ce00471b684a2e756400?highLine=40007&jumpto=comment&commentid=000c2ecf844af8542a6836adb518
上传和发客服消息用的是同一个appid吗?
这个接口文档真的就这么随心所欲吗?