Foxtable(狐表)用户栏目专家坐堂 → 关于钉钉接口的问题


  共有4068人关注过本帖树形打印复制链接

主题:关于钉钉接口的问题

帅哥哟,离线,有人找我吗?
81538475
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1302 积分:10502 威望:0 精华:1 注册:2018/1/20 12:40:00
关于钉钉接口的问题  发帖心情 Post By: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


 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110334 积分:561518 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/1/21 14:47:00 [只看该作者]

错误提示信息发上来看看

 回到顶部
帅哥哟,离线,有人找我吗?
81538475
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1302 积分:10502 威望:0 精华:1 注册:2018/1/20 12:40:00
  发帖心情 Post By: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() --------------------------- 确定 ---------------------------

 回到顶部
帅哥,在线噢!
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110334 积分:561518 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/1/21 22:45:00 [只看该作者]

应该是命名空间写错了,开发文档链接发上来看看

 回到顶部
帅哥哟,离线,有人找我吗?
81538475
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1302 积分:10502 威望:0 精华:1 注册:2018/1/20 12:40:00
  发帖心情 Post By:2020/1/21 22:52:00 [只看该作者]


 回到顶部
帅哥,在线噢!
有点蓝
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110334 积分:561518 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By: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
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1302 积分:10502 威望:0 精华:1 注册:2018/1/20 12:40:00
  发帖心情 Post By: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
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1302 积分:10502 威望:0 精华:1 注册:2018/1/20 12:40:00
  发帖心情 Post By: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
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1302 积分:10502 威望:0 精华:1 注册:2018/1/20 12:40:00
  发帖心情 Post By:2020/1/21 23:22:00 [只看该作者]

确实是命名空间错了了

 回到顶部
帅哥哟,离线,有人找我吗?
gudao123456
  10楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:855 积分:6402 威望:0 精华:0 注册:2017/11/21 21:31:00
  发帖心情 Post By:2021/7/30 16:14:00 [只看该作者]

请问楼主,你的钉钉事件回调设置成功了吗?我的信息加解密都不成功。有什么经验可以分享吗?谢谢!QQ:360538608

 回到顶部