微信企业开发-发送消息错误代码82001


微信企业号开发调用发送消息接口报错:"errcode":82001,"errmsg":"All touser & toparty & totag invalid"

接口:https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=ACCESS_TOKEN

82001:发送消息或者邀请的参数全部为空或者全部不合法

解决方案:

1、添加通讯录的权限(开发时已设置应用的权限了,所以此项没有验证过)

2、发送的消息json格式不对,如touser写成了toUser,微信接口在传达数据时是区分大消息的

正确格式:

{
   "touser": "UserID1|UserID2|UserID3",
   "toparty": " PartyID1 | PartyID2 ",
   "totag": " TagID1 | TagID2 ",
   "msgtype": "text",
   "agentid": 1,
   "text": {
       "content": "Holiday Request For Pony(http://xxxxx)"
   },
   "safe":"0"
}

错误格式
{
   "toUser": "UserID1|UserID2|UserID3",
   "toparty": " PartyID1 | PartyID2 ",
   "totag": " TagID1 | TagID2 ",
   "msgtype": "text",
   "agentid": 1,
   "text": {
       "content": "Holiday Request For Pony(http://xxxxx)"
   },
   "safe":"0"
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM