以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  企业微信发送消息报错48002?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=117241)

--  作者:andy123
--  发布时间:2018/4/9 14:46:00
--  企业微信发送消息报错48002?
使用如下代码测试企业微信发送消息,

Dim ur As String = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={0}"
Dim
 hc As new HttpClient(Cexp(ur,Functions.Execute("GetQYAccessToken")))
Dim
 jo As New JObject
jo
("touser") = "003|001"
jo
("msgtype") = "text"
jo
("agentid") = 9
jo
("text") = New JObject
jo
("text")("content") = "您好,这是测试信息"
hc
.Content = jo.ToString
jo
 = JObject.Parse(hc.GetData)
If jo("errcode") = "0" Then
    MessageBox.show("消息发送成功!")

Else

    MessageBox.show(jo.ToString)

End
 If


报错信息如下:
---------------------------
{

  "errcode": 48002,

  "errmsg": "api forbidden, hint: [1523256126_4_ff4e6f2149b88d9bbff79367af81d166], more info at https://open.work.weixin.qq.com/devtool/query?e=48002"

}
---------------------------
确定   
---------------------------

已设置如CorpID 和Secret,请问这个报错是什么原因啊?



--  作者:有点甜
--  发布时间:2018/4/9 16:08:00
--  

权限问题

 

https://blog.csdn.net/lzk_csdn/article/details/76282936

 

 


--  作者:andy123
--  发布时间:2018/4/9 16:25:00
--  
这个已经设置为编辑状态了


还是不行
[此贴子已经被作者于2018/4/9 16:25:16编辑过]

--  作者:有点甜
--  发布时间:2018/4/9 18:31:00
--  

Secret 应该有错,认真核对。

 

https://www.baidu.com/baidu?wd=api+forbidden

 


--  作者:有点蓝
--  发布时间:2018/4/9 21:47:00
--  
不同应用的Secret是不一样的,请确认设置的是agentid9的应用Secret