苏州三木软件科技有限公司

 找回密码
 立即注册
搜索
热搜: 活动
查看: 1578|回复: 5

如何对接钉钉API接口

[复制链接]

8

主题

20

帖子

90

积分

注册会员

Rank: 2

积分
90
发表于 2023-4-18 21:21:49 | 显示全部楼层 |阅读模式

获取审批实例ID列表

请求示例(HTTP)
  1. POST https://oapi.dingtalk.com/topapi/processinstance/listids?access_token=ACCESS_TOKEN
复制代码
森之格VB中请求正文写在哪里呢?
  1. Dim dic As New Dictionary(Of String,String)
  2. dic("access_token")="PROC-FF6Y2xxxx"
  3. '定义一个网址,Post方法网址中不能包含参数
  4. Dim strUrl As String="http://oapi.dingtalk.com/topapi/processinstance/listids?"
  5. '我们可以通过NetHelp的ConvertDictionaryToPostData静态方法,将字典转换成相应的参数
  6. Dim strPostData As String=NetHelp.ConvertDictionaryToPostData(dic)
  7. '直接根据已有条件获得返回数据
  8. Dim json As String =NetHelp.NetPost(strUrl,strPostData,NetHelp.NetContentType.form)
  9. MsgBox(json)
复制代码



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

22

主题

296

帖子

1876

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1876
QQ
发表于 2023-4-18 21:32:08 | 显示全部楼层
文档地址贴出来,你这对接的不着边际。

缺少参数,HttpContentType
回复

使用道具 举报

8

主题

20

帖子

90

积分

注册会员

Rank: 2

积分
90
 楼主| 发表于 2023-4-18 21:36:38 | 显示全部楼层
admin 发表于 2023-4-18 21:32
文档地址贴出来,你这对接的不着边际。

缺少参数,HttpContentType

https://open.dingtalk.com/docume ... -retrieve-a-list-of
回复

使用道具 举报

22

主题

296

帖子

1876

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1876
QQ
发表于 2023-4-18 21:42:59 | 显示全部楼层
  1. '定义一个头部
  2. Dim header As New Dictionary(Of String,String)
  3. header("access_token")="PROC-FF6Y2xxxx"
  4. '定义一个网址,Post方法网址中不能包含参数
  5. Dim strUrl As String="https://oapi.dingtalk.com/topapi/user/getbyunionid"
  6. '定义一个临时对象
  7. Dim post = New With {.unionid = "'Kf44wavBrtYbMmGmZG5IvAiEiE"}
  8. '将临时对象转化为Json文本,作为传输内容
  9. Dim strPostData As String=JObject.FromObject(post).ToString()
  10. '直接根据已有条件获得返回数据
  11. Dim json As String =NetHelp.NetPost(strUrl,strPostData,NetHelp.NetContentType.json,header)
  12. MsgBox(json)
复制代码


希望你能看得懂。

回复

使用道具 举报

22

主题

296

帖子

1876

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1876
QQ
发表于 2023-4-18 21:55:45 | 显示全部楼层
  1. '定义一个网址,Post方法网址中不能包含参数
  2. Dim strUrl As String="https://oapi.dingtalk.com/topapi/processinstance/listids?access_token=6d1bxxxx"
  3. '定义一个临时对象
  4. Dim post = New With {.process_code = "'process_code",.start_time=1496678400000,.end_time=1496678400000,.size=10,.cursor=0,.userid_list="manager1,manager2"}
  5. '将临时对象转化为Json文本,作为传输内容
  6. Dim strPostData As String=JObject.FromObject(post).ToString()
  7. Proj.MsgDebug.Add(strPostData)
  8. '直接根据已有条件获得返回数据
  9. Dim json As String =NetHelp.NetPost(strUrl,strPostData,NetHelp.NetContentType.json)
  10. MsgBox(json)
复制代码


回复

使用道具 举报

8

主题

20

帖子

90

积分

注册会员

Rank: 2

积分
90
 楼主| 发表于 2023-4-18 22:13:17 | 显示全部楼层

可以了,原来还可以这么用,多谢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|苏州三木软件科技有限公司 ( 苏ICP备2022038390号 )

苏公网安备 32058502010732号

GMT+8, 2024-7-7 21:16 , Processed in 0.125261 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表