微信企業號開發調用發送消息接口報錯:"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"
}
