微信企業開發-發送消息錯誤代碼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