### 发起钉钉流程实例 Source: https://dingtalk.apifox.cn/doc-3568375 使用 `StartProcessInstance` 方法发起一个新的钉钉流程实例。可以为流程实例设置各种表单组件的值,包括单行输入、多行输入、多选框、日期区间和明细表格等。 ```java Config config = new Config(); config.protocol = "https"; config.regionId = "central"; com.aliyun.dingtalkworkflow_1_0.Client client = new com.aliyun.dingtalkworkflow_1_0.Client(config); StartProcessInstanceHeaders startProcessInstanceHeaders = new StartProcessInstanceHeaders(); startProcessInstanceHeaders.xAcsDingtalkAccessToken = "accessToken"; //1.单行输入框组件 StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues formComponentValues1 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues() .setName("客户名称") .setValue("小钉"); //2.多行输入框组件 StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues formComponentValues2 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues() .setName("客户描述") .setValue("潜在优质客户"); //3.多选框组件 StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues formComponentValues3; formComponentValues3 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues() .setName("客户标签") .setValue("[\"重要\",\"一般\"]") .setComponentType("DDMultiSelectField"); //4.日期区间组件 StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues formComponentValues4 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues() .setName("[\"客户达成意向开始时间\",\"客户达成意向结束时间\"]") .setValue("[\"2022-08-14 15:00\",\"2022-08-15 15:00\"]"); //5.明细表格组件 StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValuesDetails formComponentValues0Details1 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValuesDetails() .setName("名称") .setValue("钉钉F2 智能视频会议一体机"); StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValuesDetails formComponentValues0Details2 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValuesDetails() .setName("单价(元)") .setValue("29999"); StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValuesDetails formComponentValues0Details3 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValuesDetails() .setName("个数") .setValue("1"); StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValuesDetails formComponentValues0Details4 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValuesDetails() .setName("名称") .setValue("钉钉F1 智能视频会议一体机"); StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValuesDetails formComponentValues0Details5 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValuesDetails() .setName("单价(元)") .setValue("4999"); ``` -------------------------------- ### DingTalk Task Start Date Update biz_data Example Source: https://dingtalk.apifox.cn/doc-3659272 This snippet provides the biz_data structure for a DingTalk task start date update event. It includes the creator, task ID, and the updated start date. ```json { "data": { "syncAction": "project_task_updated", "eventSubType": "tb.v3.task.startDate.update", "creatorId": "0715153011125xxxx", "startDate": "2022-12-26T09:27:43.733Z", "created": "2022-12-26T09:27:43.733Z", "updated": "2022-12-26T09:27:43.733Z", "taskId": "63c7f91f6ff268bcab40xxxx" } } ``` -------------------------------- ### 搜索设备问题排查 Source: https://dingtalk.apifox.cn/doc-392730 提供了在使用 `startBluetoothDevicesDiscovery` 接口搜索设备时遇到问题的排查指南。 - 确保目标设备正在发出广播信号。 - 如果在接口调用时指定了 `services` 参数,请确认设备的广播内容中包含了指定的 `service` UUID。 ```APIDOC startBluetoothDevicesDiscovery 搜索不到设备: 原因: 1. 设备未发出广播。 2. 传入的 `services` UUID 与设备广播的 UUID 不匹配。 排查步骤: 1. 确认设备已开启蓝牙并正在广播。 2. 检查 `startBluetoothDevicesDiscovery` 接口中传入的 `services` 参数是否正确,并与设备广播的 UUID 一致。 ``` -------------------------------- ### Install DingTalk OpenAPI Go SDK Source: https://dingtalk.apifox.cn/doc-392471 Install the DingTalk OpenAPI Go SDK using the go get command. ```go go get -u github.com/alibabacloud-go/dingtalk/ ``` -------------------------------- ### 项目启动时立即执行推送数据处理 Source: https://dingtalk.apifox.cn/doc-392351 在项目启动时立即调用`processMsgInbox`方法来处理钉钉推送数据。 ```Java onProjectStart: processMsgInbox(subscribeId) ``` -------------------------------- ### Start Video Conference Cloud Recording Source: https://dingtalk.apifox.cn/api-142163460 Initiates cloud recording for a specified video conference. Requires appropriate permissions and provides details on request parameters, response codes, and usage examples. ```APIDOC paths: /v1.0/conference/videoConferences/{conferenceId}/cloudRecords/start: post: summary: 开启视频会议云录制 deprecated: false description: >+ **接口调用量说明**钉钉标准版接口累计可调用次数为1万次/月,当前接口会消耗调用次数。若该调用量无法满足需求,你可升级[钉钉专业版(Open API调用量50万次/月)](dingtalk://dingtalkclient/page/link?url=https%3A%2F%2Fn.dingtalk.com%2Fdingding%2Fweb-dd-pro%2Fmobile_microApp%2Findex.html%3FcorpId%3D%26channel%3Dopenpf_web_devdoc&web_wnd=general&width=480&height=800)或[钉钉专属版(Open API调用量500万次/月)](https://page.dingtalk.com/wow/dingtalk/act/zsdd?&spm=a2q49.26303778)扩容调用次数。 调用本接口开启视频会议云录制。 例如,企业内正在进行的视频会议如下图所示,默认情况下会议开始时未进行视频会议录制。 ![img](https://img.alicdn.com/imgextra/i2/O1CN01Y6RUoM1JEfdQk7BNf_!!6000000000997-2-tps-2196-1574.png) 调用本接口,可开启视频录制云录制,开启后的效果如下图所示。 ![img](https://img.alicdn.com/imgextra/i3/O1CN01FvFo5Z1QTyAxBJgDA_!!6000000001978-2-tps-2018-1440.png) ## 权限 要调用此API,需要以下权限之一。 | 应用类型 | 是否支持 | 权限 | API Explorer调试 | | -------------- | -------- | ---------------------- | ------------------------------------------------------------ | | 企业内部应用 | 支持 | 视频会议应用会议写权限 | [API Explorer](https://open-dev.dingtalk.com/apiExplorer#/?devType=org&api=conference_1.0%23StartCloudRecord) | | 第三方企业应用 | 支持 | 视频会议应用会议写权限 | [API Explorer](https://open-dev.dingtalk.com/apiExplorer#/?devType=isv&api=conference_1.0%23StartCloudRecord) | | 第三方个人应用 | 暂不支持 | 视频会议应用会议写权限 | 暂不支持 | ## 错误码 | HttpCode | 错误码 | 错误信息 | 说明 | | -------- | -------------------------- | --------------------- | ---------------------- | | 400 | roomClosed | the meeting has ended | 房间已关闭 | | 400 | paramsError | error:%s | 参数错误 | | 404 | recordStartError | recordStartError:%s | 开启录制失败 | | 404 | recordStartPermissionError | permissionError:%s | 录制因权限问题开启失败 | | 500 | systemError | systemError:%s | 服务端内部错误 | tags: - 服务端 API/音视频/会议 parameters: - name: conferenceId in: path description: |- 会议ID。 企业内部应用,调用创建视频会议接口获取conferenceId参数值。 第三方企业应用,调用创建视频会议接口获取conferenceId参数值。 required: true schema: type: string - name: x-acs-dingtalk-access-token in: header description: >- 调用该接口的访问凭证。 - 企业内部应用,调用[获取企业内部应用的accessToken](https://open.dingtalk.com/document/orgapp/obtain-the-access_token-of-an-internal-app)接口获取。 - 第三方企业应用,调用[获取第三方应用授权企业的accessToken](https://open.dingtalk.com/document/isvapp/obtain-the-access_token-of-the-authorized-enterprise)接口获取。 required: true schema: type: string requestBody: content: application/json: schema: type: object properties: unionId: type: string description: >- 用户unionId。 企业内部应用,调用查询用户详情接口获取unionid参数值。 第三方企业应用,调用查询用户详情接口获取unionid参数值。 说明 只有当用户是会议主持人时,才有权限开启云录制。 smallWindowPosition: type: string description: >- 小窗位置,取值: relative_right:分离右侧 float_right:悬浮右侧 float_bottom:悬浮底部 mode: type: string description: 布局,取值: grid:宫格模式 speech:演讲者模式 full_screen:全屏模式 required: - unionId x-apifox-orders: - unionId - smallWindowPosition - mode example: unionId: String smallWindowPosition: String mode: String responses: '200': description: '' content: application/json: schema: type: object properties: code: type: string description: "\t 返回码。 说明 如果视频会议云录制开启成功,且调用接口成功,该字段值为200。" required: - code x-apifox-orders: - code headers: {} x-apifox-name: 成功 security: [] x-apifox-folder: 服务端 API/音视频/会议 x-apifox-status: released x-run-in-apifox: https://app.apifox.com/web/project/467052/apis/api-142163460-run ``` ```YAML openapi: 3.0.1 info: title: '' description: '' version: 1.0.0 paths: /v1.0/conference/videoConferences/{conferenceId}/cloudRecords/start: post: summary: 开启视频会议云录制 deprecated: false description: >+ **接口调用量说明**钉钉标准版接口累计可调用次数为1万次/月,当前接口会消耗调用次数。若该调用量无法满足需求,你可升级[钉钉专业版(Open API调用量50万次/月)](dingtalk://dingtalkclient/page/link?url=https%3A%2F%2Fn.dingtalk.com%2Fdingding%2Fweb-dd-pro%2Fmobile_microApp%2Findex.html%3FcorpId%3D%26channel%3Dopenpf_web_devdoc&web_wnd=general&width=480&height=800)或[钉钉专属版(Open API调用量500万次/月)](https://page.dingtalk.com/wow/dingtalk/act/zsdd?&spm=a2q49.26303778)扩容调用次数。 调用本接口开启视频会议云录制。 例如,企业内正在进行的视频会议如下图所示,默认情况下会议开始时未进行视频会议录制。 ![img](https://img.alicdn.com/imgextra/i2/O1CN01Y6RUoM1JEfdQk7BNf_!!6000000000997-2-tps-2196-1574.png) 调用本接口,可开启视频录制云录制,开启后的效果如下图所示。 ![img](https://img.alicdn.com/imgextra/i3/O1CN01FvFo5Z1QTyAxBJgDA_!!6000000001978-2-tps-2018-1440.png) ## 权限 要调用此API,需要以下权限之一。 | 应用类型 | 是否支持 | 权限 | API Explorer调试 | | -------------- | -------- | ---------------------- | ------------------------------------------------------------ | | 企业内部应用 | 支持 | 视频会议应用会议写权限 | [API Explorer](https://open-dev.dingtalk.com/apiExplorer#/?devType=org&api=conference_1.0%23StartCloudRecord) | | 第三方企业应用 | 支持 | 视频会议应用会议写权限 | [API Explorer](https://open-dev.dingtalk.com/apiExplorer#/?devType=isv&api=conference_1.0%23StartCloudRecord) | | 第三方个人应用 | 暂不支持 | 视频会议应用会议写权限 | 暂不支持 | ## 错误码 | HttpCode | 错误码 | 错误信息 | 说明 | | -------- | -------------------------- | --------------------- | ---------------------- | | 400 | roomClosed | the meeting has ended | 房间已关闭 | | 400 | paramsError | error:%s | 参数错误 | | 404 | recordStartError | recordStartError:%s | 开启录制失败 | | 404 | recordStartPermissionError | permissionError:%s | 录制因权限问题开启失败 | | 500 | systemError | systemError:%s | 服务端内部错误 | tags: - 服务端 API/音视频/会议 parameters: - name: conferenceId in: path description: |- 会议ID。 企业内部应用,调用创建视频会议接口获取conferenceId参数值。 第三方企业应用,调用创建视频会议接口获取conferenceId参数值。 required: true schema: type: string - name: x-acs-dingtalk-access-token in: header description: >- 调用该接口的访问凭证。 - 企业内部应用,调用[获取企业内部应用的accessToken](https://open.dingtalk.com/document/orgapp/obtain-the-access_token-of-an-internal-app)接口获取。 - 第三方企业应用,调用[获取第三方应用授权企业的accessToken](https://open.dingtalk.com/document/isvapp/obtain-the-access_token-of-the-authorized-enterprise)接口获取。 required: true schema: type: string requestBody: content: application/json: schema: type: object properties: unionId: type: string description: >- 用户unionId。 企业内部应用,调用查询用户详情接口获取unionid参数值。 第三方企业应用,调用查询用户详情接口获取unionid参数值。 说明 只有当用户是会议主持人时,才有权限开启云录制。 smallWindowPosition: type: string description: >- 小窗位置,取值: relative_right:分离右侧 float_right:悬浮右侧 float_bottom:悬浮底部 mode: type: string description: 布局,取值: grid:宫格模式 speech:演讲者模式 full_screen:全屏模式 required: - unionId x-apifox-orders: - unionId - smallWindowPosition - mode example: unionId: String smallWindowPosition: String mode: String responses: '200': description: '' content: application/json: schema: type: object properties: code: type: string description: "\t 返回码。 说明 如果视频会议云录制开启成功,且调用接口成功,该字段值为200。" required: - code x-apifox-orders: - code headers: {} x-apifox-name: 成功 security: [] x-apifox-folder: 服务端 API/音视频/会议 x-apifox-status: released x-run-in-apifox: https://app.apifox.com/web/project/467052/apis/api-142163460-run ``` -------------------------------- ### 发起审批实例 Source: https://dingtalk.apifox.cn/doc-3568504 此代码片段展示了如何使用 `startProcessInstance` 方法发起一个新的审批实例。它演示了如何设置请求头和表单组件的值,包括单行输入框、多行输入框和多选框组件。该示例为发起审批实例提供了基础结构。 ```Java Config config = new Config(); config.protocol = "https"; config.regionId = "central"; com.aliyun.dingtalkworkflow_1_0.Client client = new com.aliyun.dingtalkworkflow_1_0.Client(config); StartProcessInstanceHeaders startProcessInstanceHeaders = new StartProcessInstanceHeaders(); startProcessInstanceHeaders.xAcsDingtalkAccessToken = "accessToken"; //1.单行输入框组件 StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues formComponentValues1 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues() .setName("客户名称") .setValue("小钉"); //2.多行输入框组件 StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues formComponentValues2 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues() .setName("客户描述") .setValue("潜在优质客户"); //3.多选框组件 StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues formComponentValues3; ``` -------------------------------- ### Get Live Information API Response Source: https://dingtalk.apifox.cn/api-142199212 Defines the structure of a successful response when retrieving live stream information. It includes details such as live ID, title, start and end times, status, playback duration, and viewing URLs. ```APIDOC paths: /live/getLiveInfo: get: summary: 获取直播信息 operationId: getLiveInfo responses: "200": description: 成功 content: application/json: schema: type: object properties: result: type: object properties: liveInfo: type: object properties: liveId: type: string description: 直播ID。 unionId: type: string description: 用户的unionId。 title: type: string description: 直播标题。 coverUrl: type: string description: 直播封面图URL。 startTime: type: integer description: 直播开始时间,Unix时间戳,单位秒。 endTime: type: integer description: 直播结束时间,Unix时间戳,单位秒。 introduction: type: string description: 直播简介。 liveStatus: type: integer description: 直播状态:0=未开始, 1=直播中, 2=已结束。 duration: type: integer description: 直播时长,单位秒。 subscribeCount: type: integer description: 订阅人数。 uv: type: integer description: 观看人数。 livePlayUrl: type: string description: 直播观看地址。 playbackDuration: type: integer description: 直播回放时长,单位毫秒。 required: - liveId - unionId - title - coverUrl - startTime - endTime - introduction - liveStatus - duration - subscribeCount - uv - livePlayUrl - playbackDuration x-apifox-orders: - liveId - unionId - title - coverUrl - startTime - endTime - introduction - liveStatus - duration - subscribeCount - uv - livePlayUrl - playbackDuration description: 直播信息。 required: - liveInfo x-apifox-orders: - liveInfo description: 返回结果。 required: - result x-apifox-orders: - result security: [] x-apifox-name: 成功 x-apifox-folder: 服务端 API/音视频/直播 x-apifox-status: released x-run-in-apifox: https://app.apifox.com/web/project/467052/apis/api-142199212-run servers: - url: https://api.dingtalk.com description: 正式环境 security: [] ``` -------------------------------- ### Get DingTalk Attendance Report Column Values Source: https://dingtalk.apifox.cn/doc-3562063 Fetches the values for specific columns in DingTalk attendance reports for a given user and date range. Requires user ID, a list of column IDs, and the start and end dates. An access token is necessary for authentication. ```java public void attendanceColumnsValue() throws ApiException { DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/attendance/getcolumnval"); OapiAttendanceGetcolumnvalRequest req = new OapiAttendanceGetcolumnvalRequest(); req.setUserid("01472825524039877041"); req.setColumnIdList("184678999,184727001"); req.setFromDate(StringUtils.parseDateTime("2022-10-24 00:00:00")); req.setToDate(StringUtils.parseDateTime("2022-10-25 00:00:00")); OapiAttendanceGetcolumnvalResponse rsp = client.execute(req, "access_token"); System.out.println(rsp.getBody()); } ``` -------------------------------- ### dd.startBluetoothDevicesDiscovery API 参数 Source: https://dingtalk.apifox.cn/doc-392745 该API用于启动蓝牙设备搜寻,支持配置搜寻的蓝牙服务、是否允许重复上报设备、上报间隔以及回调函数。 ```APIDOC dd.startBluetoothDevicesDiscovery(options) Parameters: services (Array, optional): 蓝牙设备主 service 的 uuid 列表。 allowDuplicatesKey (Boolean, optional): 是否允许重复上报同一设备。如果为true,则onBluetoothDeviceFound方法会多次上报同一设备,但RSSI值会有不同。 interval (Integer, optional): 上报设备的间隔,默认为0,表示找到新设备立即上报。否则根据传入的间隔上报。 success (Function, optional): 调用成功的回调函数。 fail (Function, optional): 调用失败的回调函数。 complete (Function, optional): 调用结束的回调函数(调用成功、失败都会执行)。 ``` -------------------------------- ### Start DingTalk Process Instance Source: https://dingtalk.apifox.cn/doc-3568375 Initiates a new process instance in DingTalk. This involves setting up various form component values, defining approvers, and specifying the process code. The example demonstrates how to construct the `StartProcessInstanceRequest` object with detailed configurations for different fields and approval flows. ```java StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValuesDetails formComponentValues0Details6 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValuesDetails() .setName("个数") .setValue("5"); StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues formComponentValues5 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues() .setName("明细") .setValue(JSON.toJSONString(Arrays.asList(Arrays.asList(formComponentValues0Details1, formComponentValues0Details2, formComponentValues0Details3), Arrays.asList(formComponentValues0Details4, formComponentValues0Details5, formComponentValues0Details6)))) .setDetails(Arrays.asList(formComponentValues0Details1, formComponentValues0Details2, formComponentValues0Details3, formComponentValues0Details4, formComponentValues0Details5, formComponentValues0Details6)); //6.联系人组件 StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues formComponentValues6 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues() .setName("联系人") .setValue(JSON.toJSONString(Arrays.asList("联系人userId"))); //7.部门组件 StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues formComponentValues7 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues() .setName("联系人部门") .setValue("部门ID"); //8.省市区组件 StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues formComponentValues8 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues() .setName("客户地址") .setValue(JSON.toJSONString(Arrays.asList("北京,北京市,朝阳区,东湖街道,xxxxxxxA座"))); //9.单选框组件 StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues formComponentValues9 = new StartProcessInstanceRequest.StartProcessInstanceRequestFormComponentValues() .setName("审批需求状态") .setValue("紧急"); //设置审批人 //会签审批 StartProcessInstanceRequest.StartProcessInstanceRequestApprovers approvers0 = new StartProcessInstanceRequest.StartProcessInstanceRequestApprovers() .setActionType("AND") .setUserIds(java.util.Arrays.asList( "014******77041", "0852*******284272" )); //或签审批 StartProcessInstanceRequest.StartProcessInstanceRequestApprovers approvers1 = new StartProcessInstanceRequest.StartProcessInstanceRequestApprovers() .setActionType("OR") .setUserIds(java.util.Arrays.asList( "014******77041", "0852*******284272" )); StartProcessInstanceRequest startProcessInstanceRequest = new StartProcessInstanceRequest() .setOriginatorUserId("发起人userId") .setProcessCode("PROC-ECED8693-****-****-****-A5EE2F7E9F46") .setDeptId(1L) .setMicroappAgentId(118*****5L) .setApprovers(java.util.Arrays.asList( approvers0, approvers1 )) //抄送人 .setCcList(java.util.Arrays.asList( "抄送人userId" )) .setCcPosition("FINISH") .setFormComponentValues(java.util.Arrays.asList( formComponentValues1, formComponentValues2, formComponentValues3, formComponentValues4, formComponentValues5, formComponentValues6, formComponentValues7, formComponentValues8, formComponentValues9 )); try { StartProcessInstanceResponse startProcessInstanceResponse = client.startProcessInstanceWithOptions(startProcessInstanceRequest, startProcessInstanceHeaders, new RuntimeOptions()); System.out.println(JSON.toJSONString(startProcessInstanceResponse.getBody())); } catch (TeaException err) { if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) { // err 中含有 code 和 message 属性,可帮助开发定位问题 System.out.println(err.code); System.out.println(err.message); } } catch (Exception _err) { TeaException err = new TeaException(_err.getMessage(), _err); if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) { // err 中含有 code 和 message 属性,可帮助开发定位问题 System.out.println(err.code); System.out.println(err.message); } } ``` -------------------------------- ### 通知审批通过 (旧版SDK) Source: https://dingtalk.apifox.cn/api-9093304 通过本接口通知钉钉考勤审批通过,支持加班、请假、外出和出差类型。接口调用量说明:钉钉标准版接口累计可调用次数为1万次/月。该接口已迁移至历史文档,仅保持现有功能,不再新增支持其他能力。 ```APIDOC paths: /topapi/attendance/approve/finish: post: summary: 通知审批通过(旧版SDK) deprecated: false description: >+ ** 接口调用量说明**钉钉标准版接口累计可调用次数为1万次/月,当前接口会消耗调用次数。若该调用量无法满足需求,你可升级[钉钉专业版(Open API调用量50万次/月)](dingtalk://dingtalkclient/page/link?url=https%3A%2F%2Fn.dingtalk.com%2Fdingding%2Fweb-dd-pro%2Fmobile_microApp%2Findex.html%3FcorpId%3D%26channel%3Dopenpf_web_devdoc&web_wnd=general&width=480&height=800)或[钉钉专属版(Open API调用量500万次/月)](https://page.dingtalk.com/wow/dingtalk/act/zsdd?&spm=a2q49.26303778)扩容调用次数。 通过本接口,通知审批通过,支持加班、请假、外出和出差类型。 **重要** 为提升接口的使用体验,提供更加规范的接口,钉钉对本文档接口进行了升级,从[旧版升级到新版](https://open.dingtalk.org/document/orgapp/differences-between-server-apis-and-new-server-apis#),本接口文档将于 **2024 年 1 月 22 日**迁移至**历史文档**目录,且本接口**仅保持现有功能,不再新增支持其他能力**。 - 如果未使用本接口,推荐使用新版[通知审批通过](https://open.dingtalk.org/document/orgapp/api-processapprovefinish#)接口。 - 如果已使用本接口,建议您根据自身实际情况评估是否切换至推荐接口。 例如,员工今日排班是8:00-18:00,在企业自有审批系统提交了请假,审批通过后通过本接口通知钉钉考勤,今天该员工无需打卡,不会被记为旷工,卡点状态会显示为请假。 例如,员工小钉在11月15日未执行打卡,考勤统计中显示如下图。 ![img](https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/7014958661/p520504.png) 调用本接口,通知审批通过,可实现修改员工小钉在11月15日的考勤为请假、出差或者加班,如下图所示。 ![img](https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/7014958661/p520511.png) ## 权限 服务端API是以应用维度授权的,在调用接口前,确保已经为应用添加了接口权限。 | 应用类型 | 是否支持调用 | 权限申请方式 | API Explorer调试 | | -------------- | ------------ | -------------- | -------------- | | 企业内部应用 | 是 | 考勤组管理权限 | [调试](https://open-dev.dingtalk.com/apiExplorer#/?devType=org&api=dingtalk.oapi.attendance.approve.finish) | | 第三方企业应用 | 是 | 考勤组管理权限 | [调试](https://open-dev.dingtalk.com/apiExplorer#/?devType=isv&api=dingtalk.oapi.attendance.approve.finish) | | 第三方个人应用 | 否 | — | — | tags: - 服务端 API/考勤/假勤审批 - 企业内部应用 - 第三方企业应用 - oapi parameters: - name: access_token in: query description: >- 调用服务端API的应用凭证。企业内部应用可通过获取企业内部应用的access_token接口获取。第三方企业应用可通过获取第三方企业应用的access_token接口获取。 required: true example: 6d1bxxxx schema: type: string requestBody: content: application/json: schema: type: object properties: userid: type: string description: 员工的userid。 biz_type: type: number description: 审批单类型:1:加班2:出差、外出3:请假 from_time: type: string description: >- 开始时间。开始时间不能早于当前时间前31天。支持以下格式:2019-08-152019-08-15 AM2019-08-15 12:43 to_time: type: string description: >- 结束时间。结束时间减去开始时间的天数不能超过31天。biz_type为1时结束时间减去开始时间不能超过1天。支持以下格式:2019-08-152019-08-15 AM2019-08-15 12:43 duration_unit: type: string description: >- 时长单位,支持格式如下:dayhalfDayhour:biz_type为1时仅支持hour。时间格式必须与时长单位对应:2019-08-15对应day2019-08-15 AM对应halfDay2019-08-15 12:43对应hour calculate_model: type: number description: 计算方法:0:按自然日计算1:按工作日计算 tag_name: type: string description: 审批单类型名称,最大长度20个字符。支持类型如下:请假出差外出加班 sub_type: type: string description: 子类型名称,最大长度20个字符。审批单类型biz_type=3时,该参数必传。 approve_id: type: string description: 审批单ID,最大长度100个字符,可通过查询企业考勤排班详情接口获取。 jump_url: type: string description: 审批单跳转地址,最大长度200个字符。 overtime_duration: type: string description: biz_type为1时必传,加班时长单位小时。 overtime_to_more: type: number description: biz_type为1时必传:1:加班转调休2:加班转工资 required: - userid - biz_type - from_time - to_time - duration_unit - calculate_model - tag_name - approve_id - jump_url example: jump_url: https://open.dingtalk.com/ sub_type: 年假 overtime_duration: '1.07' tag_name: 请假 ``` -------------------------------- ### DingTalk Knowledge Base Directory Tree Management APIs Source: https://context7_llms APIs for managing the directory tree structure of knowledge bases in DingTalk, including creating documents, getting nodes, getting node lists, getting nodes by link, and batch getting nodes. ```APIDOC Create Knowledge Base Document: URL: https://dingtalk.apifox.cn/api-141796621.md Description: Creates a document within a knowledge base. ``` ```APIDOC Get Node: URL: https://dingtalk.apifox.cn/api-141797343.md Description: Retrieves a specific node within the knowledge base directory tree. ``` ```APIDOC Get Node List: URL: https://dingtalk.apifox.cn/api-141798046.md Description: Retrieves a list of nodes within the knowledge base directory tree. ``` ```APIDOC Get Node by Link: URL: https://dingtalk.apifox.cn/api-141799406.md Description: Retrieves a node using its link. ``` ```APIDOC Batch Get Nodes: URL: https://dingtalk.apifox.cn/api-141801112.md Description: Retrieves multiple nodes in a batch. ``` -------------------------------- ### 成员资料页与文档酷应用开发参考 Source: https://context7_llms 提供成员资料页酷应用和文档酷应用的开发参考,包括创建通讯录卡片、扩展互动卡片能力、配置Manifest以及开发脚本服务和UI页面。 ```APIDOC APIDOC: /llmstxt/dingtalk_apifox_cn_llms_txt - 开发应用 > 开发酷应用 > 开发单聊酷应用 > 开发成员资料页酷应用 > 成员资料页开发参考 [创建通讯录卡片](https://dingtalk.apifox.cn/doc-3528009.md) - 开发应用 > 开发酷应用 > 开发单聊酷应用 > 开发成员资料页酷应用 > 成员资料页开发参考 [成员资料页扩展互动卡片能力](https://dingtalk.apifox.cn/doc-3528012.md) - 开发应用 > 开发酷应用 > 开发单聊酷应用 > 开发文档酷应用、 > 文档酷应用开发参考 [配置文档酷应用Manifest](https://dingtalk.apifox.cn/doc-3528017.md) - 开发应用 > 开发酷应用 > 开发单聊酷应用 > 开发文档酷应用、 > 文档酷应用开发参考 [开发文档酷应用脚本服务和 UI 页面](https://dingtalk.apifox.cn/doc-3528025.md) ```