发送「学校通知」调用失败
1:使用自建应用的agendid发送消息,返回错误如下:
{"errcode":301002,"errmsg":"not allow operate another agent with this accesstoken., hint: [1578655260_55_053437161ac0fa515d91891f7fd089e0], from ip: 115.193.160.192, more info at https://open.work.weixin.qq.com/devtool/query?e=301002","invalid_external_user":[],"invalid_tag":[],"invalid_parent_userid":[],"invalid_student_userid":[],"invalid_party":[]}
2:使用外部联系人agentid,返回错误如下:
{"errcode":48002,"errmsg":"api forbidden, hint: [1578653419_54_844735d2b231fb9cea8acca9d26d0266], from ip: 121.41.59.140, more info at https://open.work.weixin.qq.com/devtool/query?e=48002","invalid_external_user":[],"invalid_tag":[],"invalid_parent_userid":[],"invalid_student_userid":[],"invalid_party":[]}
请问企业微信教育版中的”自建应用“需要如何配置,才能调用「学校通知」给家长发送消息
您好,查了下发现是使用的外部联系人的secret发消息给家长,所以报错了,这里只要把应用配置进去那个家长可以使用的应用就可以了,然后使用自建应用的secret即可发送消息
请求:
https://qyapi.weixin.qq.com/cgi-bin/externalcontact/message/send?access_token=fpke_pOZZfWRRoOHEkuzGLUrz8gK_TdRns5FFuUojxDf4N54Q34Kc2fgyZ-wcDGDq079kIjdRHXKULH_4P7x3ymsLDZ-N4pdipybDeOjFpu1Xvh520EO9219gNBN7auaxwT61qmTkNKAQdSSqB1qZN8O4urQvHV-s5hDIK38Z3zVTOF4VtZQMBzRj1_1Ny_fe1jBWidFYqytrkAz0PZmAg
{"to_parent_userid":["wmM-UXCwAAymHIC0Vdr73lxOnwJrVSfg"],"msgtype":"text","agentid":1000004,"text":{"content":"好嘛空间\n\u003ca href=\"http://wx.jxhlw.com/Mobile/Notice/detail/type/receive/id/293/gzh_id/wx10008c05e74475a3/M_MSG_ID/2086/M_MSG_UID/23307\" 点击查看详情\u003c/a\u003e"}}]]
返回错误:
{"errcode":81013,"errmsg":"user & party & tag all invalid, hint: [1578658669_55_1568b6facf8b61da68aeff875e595267], from ip: 115.193.160.192, more info at https://open.work.weixin.qq.com/devtool/query?e=81013","invalid_external_user":[],"invalid_tag":[],"invalid_parent_userid":["wmM-UXCwAAymHIC0Vdr73lxOnwJrVSfg"],"invalid_student_userid":[],"invalid_party":[]}
遇到同样问题,无法通过API发送学校通知
https://qyapi.weixin.qq.com/cgi-bin/externalcontact/message/send?access_token=83HNdNg41mIpUodDqVaaB1VhBp2xlvkIbogtHQm2rXXkbtCht921QchQ4H5mgj6eFWAtXABC_GzBDmZnvn56VDPBhvAO1wVjHjwyEsEJ4pFL5Pm3OxEQd8jqEYtJbVTaU4qW0kO_oCn54c_Lg7YSlxrKm0yWMIAaGI7CefkNoRsMGef5fA5DkOIC6YTE3BiX1LiqMuOmWXj5w5bd8MXt9g
{"to_parent_userid":["562a16825a94c55b3e726be31bee9475"],"toall":0,"msgtype":"text","agentid":1000004,"text":{"content":"2021-01-25还未完成,请尽快完成!!"}}
{"errcode":301002,"errmsg":"Warning: wrong json format. not allow operate another agent with this accesstoken., hint: [1611576305_150_7c4a566c8ea6c9a638536297a03716e4], from ip: more info at https://open.work.weixin.qq.com/devtool/query?e=301002","invalid_external_user":[],"invalid_tag":[],"invalid_parent_userid":[],"invalid_student_userid":[],"invalid_party":[]}