Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在调用 GroupMessageApi.SendGroupMessagePreview接口时发送视频消息,返回的errcode是0,但msg_id为空字符串。微信能收到视频消息,但点开查看详情时却显示“参数错误” #1542

Closed
5 tasks done
wtujvk opened this issue Dec 29, 2018 · 5 comments

Comments

@wtujvk
Copy link
Contributor

wtujvk commented Dec 29, 2018

问题描述

在调用 GroupMessageApi.SendGroupMessagePreview接口时发送视频消息,返回的errcode是0,但msg_id为空字符串。微信能收到视频消息,但点开查看详情时却显示“参数错误”

重现问题步骤(如果可以)
  1. 上传视频得到素材id: 调用接口 SenparcMedia.UploadForeverVideo
  2. 预览此视频: GroupMessageApi.SendGroupMessagePreview
微信官方文档 URL

新增其他类型永久素材
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444738729
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1481187827_i0l21
调试发现 参数groupMessageType是video但返回的type是image
image
怀疑的问题: 1. 视频上传是否成功,获取的素材id是否合法。上传的视频不会审核
2. 群发预览是否正确,为何返回的type是image,而且msg_id是null

微信官方文档快照(直接复制关键内容到下方)

image
image
效果:
image
image

发现问题的模块
  • Senparc.Weixin 版本:4.20.2
  • Senparc.Weixin.MP 版本:14.10.3
模块对应的 .net 版本
  • .net 4.5 (网站程序环境是.net 4.6)
开发环境
  • Visual Studio 2017
缓存环境
  • 服务器内存缓存(默认)
联系方式

Email:1170971516@qq.com
社区问题: https://weixin.senparc.com/QA-187

发布问题后,请保持对 issue 的关注,有时会有需要进一步沟通的信息,很长时间内没有得到答复的 issue 将被关闭。

@JeffreySu
Copy link
Owner

@wtujvk 确实我这边测试也是这样的,已经完全按照官方的接口开发,我做了一个新的单元测试:

@JeffreySu
Copy link
Owner

不过第一个获取MediaId的接口:MediaApi.UploadTemporaryMedia() 返回的结果是正常的:

{"media_id":"nqU8vIFjVC1QbXW7LpM9_L_fiB-sym63aVDD6h4mLo51GwL7VDGcs0H0qqxk5erH","type":"video","created_at":1546181338,"errcode":0,"ErrorCodeValue":0,"errmsg":null,"P2PData":null}

@wtujvk
Copy link
Contributor Author

wtujvk commented Jan 2, 2019

看文档,群发视频要用另外的接口上传素材吗?
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1481187827_i0l21
image

视频

请注意,此处视频的media_id需通过POST请求到下述接口特别地得到:https://api.weixin.qq.com/cgi-bin/media/uploadvideo?access_token=ACCESS_TOKEN POST数据如下(此处media_id需通过基础支持中的上传下载多媒体文件来得到):

{
"media_id": "rF4UdIMfYK3efUfyoddYRMU50zMiRmmt_l0kszupYh_SzrcW5Gaheq05p_lHuOTQ",
"title": "TITLE",
"description": "Description"
}

@wtujvk
Copy link
Contributor Author

wtujvk commented Jan 2, 2019

参考: 视频无法发送呀 #65

@JeffreySu
Copy link
Owner

很久之前文件上传接口https的不稳定,现在应该所有的接口使用https都没问题了。

我http和https都试了一下,结果是一样的(可以收到群发消息,并且打开时显示参数错误)

上述单元测试返回的结果:

Video Upload Result:WxJsonResult:{errcode:'0',errcode_name:'请求成功',errmsg:''}
GetVideoMediaIdResult{"media_id":"D-1yedwC1V_anb5Qtri_sJUOtvzFGZcGddX69BUyfSjbakskFaBUUUbI4Pc9KgHH","type":"video","created_at":1546409056,"errcode":0,"ErrorCodeValue":0,"errmsg":null,"P2PData":null}
AppId:wxe273c3a02e09ff8c
OpenId:oxRg0uLsnpHjb8o93uVnwMK_WAVw
{"type":0,"msg_id":null,"msg_data_id":null,"errcode":0,"ErrorCodeValue":0,"errmsg":"preview success","P2PData":null}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants