以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  关于钉钉接口的问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=145472)

--  作者:81538475
--  发布时间:2020/1/21 14:32:00
--  关于钉钉接口的问题
添加了引用.为啥还是提示未定义类型呢.

Dim client As   DingTalk.Api.DefaultDingTalkClient = new  DingTalk.Api.DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken")
Dim request As  DingTalk.Api.Response.OapiGettokenRequest = new DingTalk.Api.Response.OapiGettokenRequest()
request.Appkey="xxx"
request.Appsecret="xxxxx"
request.SetHttpMethod("GET")
Dim rsp As  DingTalk.Api.Response.OapiGettokenResponse = client.Execute(request)
String result = rsp.Body


--  作者:有点蓝
--  发布时间:2020/1/21 14:47:00
--  
错误提示信息发上来看看
--  作者:81538475
--  发布时间:2020/1/21 22:41:00
--  
以下是引用有点蓝在2020/1/21 14:47:00的发言:
错误提示信息发上来看看

--------------------------- 错误 --------------------------- 编译错误:未定义类型“DingTalk.Api.Response.OapiGettokenRequest”。 错误代码:Dim request As DingTalk.Api.Response.OapiGettokenRequest = new DingTalk.Api.Response.OapiGettokenRequest() --------------------------- 确定 ---------------------------
--  作者:有点蓝
--  发布时间:2020/1/21 22:45:00
--  
应该是命名空间写错了,开发文档链接发上来看看
--  作者:81538475
--  发布时间:2020/1/21 22:52:00
--  
https://ding-doc.dingtalk.com/doc#/serverapi2/eev437  多谢帮看看
--  作者:有点蓝
--  发布时间:2020/1/21 23:10:00
--  
Dim request As  DingTalk.Api.Request.OapiGettokenRequest = new DingTalk.Api.Request.OapiGettokenRequest()

建议下载.net的sdk源码查看:https://ding-doc.dingtalk.com/doc#/faquestions/vzbp02

--  作者:81538475
--  发布时间:2020/1/21 23:18:00
--  
Namespace DingTalk.Api
    Public Class DefaultDingTalkClient
        Implements IDingTalkClient

        Public Sub New(serverUrl As String)
        Public Sub New(serverUrl As String, format As String)

        Public Sub SetTimeout(timeout As Integer)
        Public Sub SetReadWriteTimeout(readWriteTimeout As Integer)
        Public Sub SetDisableParser(disableParser As Boolean)
        Public Sub SetDisableTrace(disableTrace As Boolean)
        Public Sub SetUseSimplifyJson(useSimplifyJson As Boolean)
        Public Sub SetUseGzipEncoding(useGzipEncoding As Boolean)
        Public Sub SetIgnoreSSLCheck(ignore As Boolean)
        Public Sub SetSystemParameters(systemParameters As IDictionary(Of String, String))

        Public Overridable Function Execute(Of T As DingTalkResponse)(request As IDingTalkRequest(Of T)) As T
        Public Overridable Function Execute(Of T As DingTalkResponse)(request As IDingTalkRequest(Of T), session As String) As T
        Public Overridable Function Execute(Of T As DingTalkResponse)(request As IDingTalkRequest(Of T), session As String, timestamp As Date) As T
        Public Function Execute(Of T As DingTalkResponse)(request As IDingTalkRequest(Of T), accessKey As String, accessSecret As String) As T
        Public Function Execute(Of T As DingTalkResponse)(request As IDingTalkRequest(Of T), accessKey As String, accessSecret As String, suiteTicket As String) As T
        Public Function Execute(Of T As DingTalkResponse)(request As IDingTalkRequest(Of T), accessKey As String, accessSecret As String, suiteTicket As String, corpId As String) As T
    End Class
End Namespace


--  作者:81538475
--  发布时间:2020/1/21 23:21:00
--  
Namespace DingTalk.Api.Request
    Public Class OapiGettokenRequest
        Inherits BaseDingTalkRequest(Of OapiGettokenResponse)

        Public Sub New()

        Public Property Appkey As String
        Public Property Appsecret As String
        Public Property Corpid As String
        Public Property Corpsecret As String

        Public Overrides Sub Validate()

        Public Overrides Function GetApiName() As String
        Public Overrides Function GetApiCallType() As String
        Public Overrides Function GetParameters() As IDictionary(Of String, String)
    End Class
End Namespace


--  作者:81538475
--  发布时间:2020/1/21 23:22:00
--  
确实是命名空间错了了
--  作者:gudao123456
--  发布时间:2021/7/30 16:14:00
--  
请问楼主,你的钉钉事件回调设置成功了吗?我的信息加解密都不成功。有什么经验可以分享吗?谢谢!QQ:360538608