钉钉API调试工具使用
地址任如下:
通过/oauth2/accessToken 获取企业内部应用的accessToken
{ "appKey":"dingaii70403vqfd3eretf", "appSecret":"dr-U5LuqHZ4rwer_Dfddrt_D8WFPHvpl5a2fBwLCTO-UN8F1Jey1ZMzbbRzRz" }
{ "expireIn":7200, "accessToken":"630bf0c2100b3bd483f522940eb525a3" }
通过上面的accessToken调用相应应用的api
如获取部门列表等
通过 processCode,获取对应表单的 schema 信息
提交审批申请
https://oapi.dingtalk.com/topapi/processinstance/create
agent_id:1449967715 process_code:PROC-5DAE4DAB-99B7-46CC-990E-8BC07F4AF27E originator_user_id:010155213221415221 dept_id:593680465 { "form_component_values": [ { "name": "本部门薪资汇总表", "value": [ [ { "name":"工号", "value":"00005" }, { "name":"姓名", "value":"测试" }, { "name": "入司时间", "value": "2018-08-17" }, { "name": "实发薪资", "value": "2000" } ], [{ "name":"工号", "value":"00006" }, { "name":"姓名", "value":"测试" }, { "name": "入司时间", "value": "2018-08-17" }, { "name": "实发薪资", "value": "2000" } ], [{ "name":"工号", "value":"00007" }, { "name":"姓名", "value":"测试" }, { "name": "入司时间", "value": "2018-08-17" }, { "name": "实发薪资", "value": "2000" } ] ] }, { "name": "本部门工资明细表", "value": [ [ { "name":"工号", "value":"00005" }, { "name":"姓名", "value":"测试" }, { "name": "入司时间", "value": "2018-08-17" }, { "name": "实发薪资", "value": "2000" } ], [{ "name":"工号", "value":"00006" }, { "name":"姓名", "value":"测试" }, { "name": "入司时间", "value": "2018-08-17" }, { "name": "实发薪资", "value": "2000" } ], [{ "name":"工号", "value":"00007" }, { "name":"姓名", "value":"测试" }, { "name": "入司时间", "value": "2018-08-17" }, { "name": "实发薪资", "value": "2000" } ] ] } ], "agent_id": 1449967715, "process_code": "PROC-5DAE4DAB-99B7-46CC-990E-8BC07F4AF27E", "cc_position": "FINISH", "dept_id": 593680465, "originator_user_id": "010155213221415221" }
用下面的方式也是可行的,用postman
获取审批实例详情 https://oapi.dingtalk.com/topapi/processinstance/get?access_token=8286562206a430449db1b01d6d0bdfe1
{ "form_component_values": [ { "name": "部门", "value": "信息部" }, { "name": "年月", "value": "2021-12" }, { "name": "总额", "value": "3060" }, { "name": "本部门工资汇总表", "value": [ [ { "name":"工号", "value":"00005" }, { "name":"姓名", "value":"测试" }, { "name":"部门编号", "value":"07" }, { "name":"部门", "value":"信息部" }, { "name": "个人奖金", "value": "1200" }, { "name": "代扣保险", "value": "100" }, { "name": "入司时间", "value": "2016-08-17" } ], [{ "name":"工号", "value":"00006" }, { "name":"姓名", "value":"测试" }, { "name":"部门编号", "value":"07" }, { "name":"部门", "value":"信息部" }, { "name": "个人奖金", "value": "1200" }, { "name": "代扣保险", "value": "200" }, { "name": "入司时间", "value": "2017-08-17" } ], [{ "name":"工号", "value":"00007" }, { "name":"姓名", "value":"测试" }, { "name":"部门编号", "value":"07" }, { "name":"部门", "value":"信息部" }, { "name": "个人奖金", "value": "1200" }, { "name": "代扣保险", "value": "300" }, { "name": "入司时间", "value": "2018-08-17" } ] ] } ], "agent_id": 1449967715, "process_code": "PROC-5DAE4DAB-99B7-46CC-990E-8BC07F4AF27E", "cc_position": "START", "dept_id": 593680465, "originator_user_id": "010155213221415221" }
通过免登码获取用户信息
获取微应用后台免登的access_token
{ "errcode":0, "access_token":"8459b0307a083acf92e9d5de2b59dead", "errmsg":"ok", "expires_in":7200 }