以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 易联云打印获取accesstoken的问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=123137) |
-- 作者:bobolan521 -- 发布时间:2018/8/8 17:30:00 -- 易联云打印获取accesstoken的问题 代码如下: Select Case e.Path Case "tx.htm" Dim st As New Date(1970,1,1,8,0,0) Dim timestamp As Integer = CInt((Date.Now - st).TotalSeconds()) \'时间戳 Dim sign As String sign="10514047" & timestamp & "a078c45b8eacee15db27c4d6892f90" sign = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sign, "MD5").ToLower Dim jo As New JObject jo("client_id") = "10514047" jo("grant_type") = "client_redentials" jo("sign") = sign jo("scope") = "all" jo("timestamp") = timestamp jo("id") = "3F2504E0-4F89-11D3-9A0C-082C3301" Dim URL As String = "https://open-api.10ss.net/oauth/oauth" Dim hc As New HttpClient(URL) hc.Content = jo.ToString() jo = JObject.Parse(hc.GetData()) If jo("error") = "0" Then MessageBox.Show("消息发送成功") Else MessageBox.show("消息发送失败,原因:" & vbcrlf & jo("error").ToString) End If e.WriteString("消息发送失败,原因:" & vbcrlf & jo("error").ToString) End Select 请问一下老师,代码这么写对不对啊 api文档地址 [此贴子已经被作者于2018/8/8 17:48:10编辑过]
|
-- 作者:有点甜 -- 发布时间:2018/8/8 17:38:00 -- 1、请求参数,不是发json。参考 http://www.foxtable.com/mobilehelp/scr/0159.htm
2、如果调用失败,请贴出返回的错误提示。 |
-- 作者:bobolan521 -- 发布时间:2018/8/8 17:44:00 -- 好的谢谢老师,我再试一下 |