审批接口.md 9.49 KB

[toc]

钉钉审批对接API

则一提供了不同规范的API,调用服务端API前,需了解开发前须知及调用流程。本文提供了调用则一服务端API示例,供开发者参考。

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">白名单

则一服务端API接口访问有IP白名单限制,需要接口调用方提供调用API的服务器IP地址。

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">数据加签

采用md5(32位小写)算法生成签名 appKey(则一提供) + appSecret(则一提供) + timestamp(当前时间戳毫秒) + nonce(6位随机码大小写字母数子组合) + data(请求数据)

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">数据加密

数据加密采用AES算法 加密模式: CBC 填充方式:PKCS5Padding 偏移量:iv(则一提供) 加密内容:appKey(则一提供) + timestamp(当前时间戳毫秒) + nonce(6位随机码大小写字母数子组合) + data(加密数据) 密钥: appSecret(则一提供) 输出:base64 字符集:utf-8 注:无敏感数据则无需加密

1.发起审批

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">简要描述

发起审批接口,接收金润发起审批请求数据

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">调用方式

金润---->则一

请求URL

· 测试环境:https://test.shjiuze.cn/tms-service-api/audit/send

· 生产环境:https://gw.shjiuze.cn/tms-service-api/audit/send

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">请求方式

POST

Headers参数

名称 类型 必填 示例值 描述
appKey String 0867ef5f23ef446483749e19e1692b40 则一提供
timestamp String 1643251533306 当前时间戳毫秒值
nonce String gdst9t 6位小写字母数字组合随机串
sign String fa3ed338d6dfe18e7273c8692234ee70 签名:appKey(则一提供) + appSecret(则一提供) + timestamp + nonce(6位随机码) + data(body参数)通过md5(32位小写)算法生成

Body参数

参数名 必传 类型 说明
code string 业务编号(确定数据唯一性,同一编号最多只能有1个审核通过或审核中的审批)
auditType string 审批类型(则一提供)
originatorUsername string 发起人工号(则一员工工号)
orgCode string 业务所属组织(则一系统组织编号)
auditFormList list 审批表单字段
    type string 类型(1.text 文本格式 2.file 文件格式)
    key string 字段名称
    value string 字段值(文本格式对应文本内容, 文件格式对应文件url)
    extendValue string 字段附加值
conditionParamList list 条件参数字段
    name string 属性名
    value string 属性值

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">返回示例

{
    "success": true, //true表示请求成功, false表示产生了异常,需要看messge异常原因
    "businessException": false, //false表示无业务异常, true表示产生了业务异常,需要看messge异常原因
    "errorCode": null,
    "message": null,
    "result": null
}

2.撤销审批

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">简要描述

撤销审批接口,接收金润撤销审批请求数据

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">调用方式

金润---->则一

请求URL

· 测试环境:https://test.shjiuze.cn/tms-service-api/audit/cancel

· 生产环境:https://gw.shjiuze.cn/tms-service-api/audit/cancel

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">请求方式

POST

Headers参数

名称 类型 必填 示例值 描述
appKey String 0867ef5f23ef446483749e19e1692b40 则一提供
timestamp String 1643251533306 当前时间戳毫秒值
nonce String gdst9t 6位小写字母数字组合随机串
sign String fa3ed338d6dfe18e7273c8692234ee70 签名:appKey(则一提供) + appSecret(则一提供) + timestamp + nonce(6位随机码) + data(body参数)通过md5(32位小写)算法生成

Body参数

参数名 必传 类型 说明
code string 业务编号(确定数据唯一性)
type string 业务类型(则一提供)
remark string 撤销原因
username string 撤销人员工号(则一员工工号)

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">返回示例

{
    "success": true, //true表示请求成功, false表示产生了异常,需要看messge异常原因
    "businessException": false, //false表示无业务异常, true表示产生了业务异常,需要看messge异常原因
    "errorCode": null,
    "message": null,
    "result": null
}

3.审批回调

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">简要描述

审批结果回调接口,审批同意、拒绝、撤销、删除时接收审批结果数据.

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">调用方式

则一---->金润

请求URL

需要金润提供,以金润提供为准

· 测试环境:https://example.com/path/dingtalkAudit/callback

· 生产环境:https://example.com/path/dingtalkAudit/callback

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">请求方式

POST

Headers参数

具体以金润提供为准

名称 类型 必填 示例值 描述
Authorization String 是     Bearer a2c5680001 调用服务端API的应用凭证accessToken,通过调用获取访问凭证接口获取。
appKey String 0867ef5f23ef446483749e19e1692b40 金润提供
timestamp String 1643251533306 当前时间戳毫秒值
nonce String gdst9t 6位小写字母数字组合随机串
sign String fa3ed338d6dfe18e7273c8692234ee70 签名:appKey(金润提供) + appSecret(金润提供) + timestamp + nonce(6位随机码) + data(body参数)通过md5(32位小写)算法生成

Body参数

参数名 必传 类型 说明
code string 业务编号
auditType string 审批类型
businessId string 钉钉审批ID
type string 审批正常结束(同意或拒绝)的type为finish,审批终止的type为terminate
result string 正常结束时(agree:同意, refuse:拒绝)
auditUser string 最终审核人
remark string 审批意见

566876489dc948d49627335e9c7443f34bb75e33/jinrun/audit/审批接口.md#">附录

  1. 下载则一Java-sdk 点击下载则一SDK

2025-10-11 更新日志

  1. 接口初始化