获取单个审批实例详情
Error: 为了更好地提升接口文档的的易理解性,我们对文档进行了升级,请尽快迁移至新版本>>
通过审批实例 Instance Code 获取审批实例详情。Instance Code 由 批量获取审批实例 接口获取。
请求
| 项目 | 值 |
|---|---|
| HTTP URL | https://www.feishu.cn/approval/openapi/v2/instance/get |
| HTTP Method | POST |
| 支持的应用类型 | custom,isv |
| 权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 | approval:approval:readonly 访问审批应用 |
请求头
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | string | 是 | tenant_access_token 值格式:"Bearer access_token" 示例值:"Bearer t-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token |
| Content-Type | string | 是 | 固定值:"application/json; charset=utf-8" |
请求体
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| instance_code | String | 是 | 审批实例 Code, 若在创建的时候传了uuid, 也可以通过传uuid获取 |
| locale | String | 否 | zh-CN - 中文 en-US - 英文 ja-JP - 日文 |
| user_id | String | 否 | 发起审批用户,平台级审批时使用 |
| open_id | String | 否 | 发起审批用户 open id |
请求体示例
json
{
"instance_code": "81D31358-93AF-92D6-7425-01A5D67C4E71",
"locale": "zh-CN",
"open_id": "xxxxx",
"user_id": "xxxxxxx"
}响应
响应体
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| code | int | 是 | 错误码,非 0 表示失败 |
| msg | String | 是 | 返回码的描述 |
| data | map | 是 | 返回业务信息 |
| ∟approval_code | String | 是 | 审批定义 Code |
| ∟approval_name | String | 是 | 审批名称 |
| ∟start_time | int | 是 | 审批创建时间 |
| ∟end_time | int | 是 | 审批完成时间,未完成为 0 |
| ∟user_id | String | 是 | 发起审批用户 |
| ∟open_id | String | 是 | 发起审批用户 open id |
| ∟serial_number | String | 是 | 审批单编号 |
| ∟department_id | String | 是 | 发起审批用户所在部门 |
| ∟status | String | 是 | 审批实例状态 PENDING - 审批中 APPROVED - 通过 REJECTED - 拒绝 CANCELED - 撤回 DELETED - 删除 |
| ∟uuid | String | 是 | 用户的唯一标识id |
| ∟form | String | 是 | json字符串,控件值 |
| ∟id | String | 是 | 控件 id |
| ∟custom_id | String | 否 | 控件自定义 id,如果没有设置自定义 id,则不返回该字段 |
| ∟name | String | 是 | 控件名称 |
| ∟type | String | 是 | 控件类型 |
| ∟value | String | 是 | 控件值,不同类型格式不一样 |
| ∟ext | object | 是 | 控件的扩展字段,满足一些特殊控件值的扩展值设置 例:图片控件的ext是文件名 |
| ∟task_list | list | 是 | 审批任务列表 |
| ∟id | String | 是 | task id |
| ∟user_id | string | 否 | 审批人 自动通过、自动拒绝 task user_id 为空 |
| ∟open_id | string | 否 | 审批人 open id |
| ∟status | string | 是 | 任务状态 PENDING - 审批中 APPROVED - 同意 REJECTED - 拒绝 TRANSFERRED - 已转交 DONE - 完成 |
| ∟node_id | String | 否 | task 所属节点 id |
| ∟node_name | String | 否 | task 所属节点名称 |
| ∟custom_node_id | String | 否 | task 所属节点自定义 id, 如果没设置自定义 id, 则不返回该字段 |
| ∟type | String | 是 | 审批方式 AND -会签 OR - 或签 AUTO_PASS -自动通过 AUTO_REJECT - 自动拒绝 SEQUENTIAL - 按顺序 |
| ∟start_time | int | 是 | task 开始时间 |
| ∟end_time | int | 是 | task 完成时间, 未完成为 0 |
| ∟comment_list | list | 是 | 评论列表 |
| ∟id | String | 是 | comment id |
| ∟user_id | String | 是 | 发表评论用户 |
| ∟open_id | String | 是 | 发表评论用户 open id |
| ∟comment | String | 是 | 评论内容 |
| ∟create_time | int | 是 | 评论时间 |
| ∟timeline | list | 是 | 审批动态 |
| ∟type | String | 是 | 动态类型,不同类型 ext 内的 user_id_list 含义不一样 START - 审批开始 PASS - 通过 REJECT - 拒绝 AUTO_PASS - 自动通过 AUTO_REJECT - 自动拒绝 REMOVE_REPEAT - 去重 TRANSFER - 转交 ADD_APPROVER_BEFORE - 前加签 ADD_APPROVER - 并加签 ADD_APPROVER_AFTER - 后加签 DELETE_APPROVER - 减签 ROLLBACK_SELECTED - 指定回退 ROLLBACK - 全部回退 CANCEL - 撤回 DELETE - 删除 CC - 抄送 |
| ∟create_time | int | 是 | 发生时间 |
| ∟user_id | String | 否 | 动态产生用户 |
| ∟open_id | String | 否 | 动态产生用户 open id |
| ∟user_id_list | list | 否 | 被抄送人列表 |
| ∟open_id_list | list | 否 | 被抄送人列表 |
| ∟task_id | String | 否 | 产生动态关联的task_id |
| ∟comment | String | 否 | 理由 |
| ∟cc_user_list | list | 否 | 抄送人列表 |
| ∟user_id | String | 否 | 抄送人 user id |
| ∟cc_id | String | 否 | 审批实例内抄送唯一标识 |
| ∟open_id | String | 否 | 抄送人 open id |
| ∟ext | String | 是 | 动态其他信息,目前包括 user_id_list, user_id |
| ∟user_id_list | list | 否 | type类型 - user_id_list 含义 TRANSFER - 被转交人 ADD_APPROVER_BEFORE - 被加签人 ADD_APPROVER - 被加签人 ADD_APPROVER_AFTER - 被加签人 DELETE_APPROVER - 被减签人 |
| ∟open_id_list | list | 否 | user_id_list 对应的 open id |
| ∟user_id | String | 否 | type类型 - user_id 含义 CC - 抄送人 |
| ∟open_id | String | 否 | user_id 对应的 open_id |
| ∟node_key | string | 否 | 产生task的节点key |
| ∟modified_instance_code | string | 否 | 修改的原实例 code,仅在查询修改实例时显示该字段 |
| ∟reverted_instance_code | string | 否 | 撤销的原实例 code,仅在查询撤销实例时显示该字段 |
**控件值**: |类型|说明| |-|-| |input|--| |textarea|--| |date|RFC3339格式,2019-10-01T08:12:01+08:00| |radio/radioV2|option 中的 text 字段| |address|China/Beijing/Beijing/Chaoyang Qu/chang an jie
如果地址控件允许输入详细地址,则最后一项为用户输入的详细地址| ```json { "id": "widget1", "custom_id": "user_info", "name": "Item application", "type": "input", "value": "data" } ``` |类型|说明| |-|-| |number|--| |amount|--| |formula|--| ```json { "id": "widget1", "name": "Item application", "type": "number", "value": 1234.56 } ``` |类型|说明| |-|-| |contact|`user_id`| ```json { "id": "widget1", "name": "Item application", "type": "contact", "value": ["f8ca557e"], "open_ids": ["ou_12345"] } ```
| 类型 | 说明 |
|---|---|
| connect | instance_code |
| attachmentV2 | 附件控件, ext:value中的附件名字, 按逗号分隔 |
| image/imageV2 | 图片控件, ext:value中的图片名字, 按逗号分隔 |
json
{
"id": "widget1",
"name": "Item application",
"type": "attachmentV2",
"ext": "'Item 1 name','Item 2 name'",
"value": ["Item 1", "Item 2"]
}| 类型 | 说明 |
|---|---|
| connect | instance_code |
| attachment | 附件控件,建议用attachmentV2 |
| checkbox/checkboxV2 | option中的text字段 |
json
{
"id": "widget1",
"name": "Item application",
"type": "checkbox",
"value": ["Item 1"]
}| 类型 | 说明 |
|---|---|
| dateInterval | start和end满足RFC3339格式 |
json
{
"id": "widget1",
"name": "Item application",
"type": "dateInterval",
"value": {
"start": "2019-10-01T08:12:01+08:00",
"end": "2019-10-02T08:12:01+08:00",
"interval": 2.0
}
}| 类型 | 说明 |
|---|---|
| fieldList | value是二维数组 |
json
{
"id": "widget1",
"name": "Item application",
"type": "fieldList",
"value": [
[
{
"id": "widget1",
"type": "checkbox",
"value": ["jxpsebqp-0"]
}
]
]
}| 类型 | 说明 |
|---|---|
| document | -- |
json
{
"id":"widget1",
"type":"document",
"value":
{
"token": "doxcx7B8OzLFHExkiwYuPGAwf",
"type": "doc",
"title": "title",
"url": "https://xxx.xxx.xxx/docx/doxcx7B8OzLFHExkiwYuPGAwf"
}
}| 类型 | 说明 |
|---|---|
| department | -- |
json
{
"id":"widget1",
"type":"department",
"value":[
{
"open_id":"od-xxx"
}
]
}| 字段 | 说明 |
|---|---|
| id | 控件 ID |
| name | 控件名称 |
| type | leaveGroup |
| value | -- |
| ∟name | 假期名称 |
| ∟start | 开始时间,满足 RFC3339 格式 |
| ∟end | 结束时间,满足 RFC3339 格式 |
| ∟interval | 时长,单位天,有些假期类型用户手动输入请假时长 |
json
{
"id": "widget1",
"name": "leave",
"type": "leaveGroup",
"value": {
"name": "annual leave"
"start": "2019-10-01T00:00:00+08:00",
"end": "2019-10-02T00:0:00+08:00",
"interval": 2.0
}
}| 字段 | 说明 |
|---|---|
| id | 控件 ID |
| name | 控件名称 |
| type | leaveGroupV2 |
| value | -- |
| ∟name | 假期名称 |
| ∟start | 开始时间,满足 RFC3339 格式 |
| ∟end | 结束时间,满足 RFC3339 格式 |
| ∟interval | 时长,有些假期类型用户手动输入请假时长 |
| ∟unit | 时长单位, DAY/HOUR ,有些假期类型用户手动输入请假时长 |
| ∟reason | 原因 |
json
{
"id": "widget1",
"name": "leave",
"type": "widgetLeaveGroupV2",
"value": {
"name": "annual leave"
"start": "2019-10-01T00:00:00+08:00",
"end": "2019-10-02T00:0:00+08:00",
"interval": 2.0,
"unit": "DAY",
"reason": "out going"
}
}| 类型 | 说明 |
|---|---|
| remedyGroup | time满足RFC3339格式 |
json
{
"id": "widget1",
"name": "remedy",
"type": "remedyGroup",
"value": {
"time": "2019-10-01T08:12:01+08:00",
"reason": "forgot"
}
}| 类型 | 说明 |
|---|---|
| shiftGroup | shiftTime和returnTime满足RFC3339格式 |
json
{
"id": "widget1",
"name": "shift",
"type": "shiftGroup",
"value": {
"shiftTime": "2019-10-01T08:12:01+08:00",
"returnTime": "2019-10-02T08:12:01+08:00",
"reason": "ask for leave"
}
}| 类型 | 说明 |
|---|---|
| workGroup | start和end满足RFC3339格式 |
json
{
"id": "widget1",
"name": "work",
"type": "workGroup",
"value": {
"name": "Overtime pay"
"start": "2019-10-01T08:12:01+08:00",
"end": "2019-10-02T08:12:01+08:00",
"interval": 2.0,
"reason": "ask for leave"
}
}| 类型 | 说明 |
|---|---|
| tripGroup | start和end满足RFC3339格式 |
json
{
"id": "widget1",
"name": "trip",
"type": "tripGroup",
"value": {
"schedule": [{
"start": "2019-10-0T00:00:00Z+08:00",
"end": "2019-10-01T00:00:00Z+08:00",
"interval": 123.45,
"departure": "China/Beijing/Beijing",
"destination": "China/Shanghai/Shanghai",
"transportation": "Airplane",
"oneRound": "One Way",
"remark": "business",
}],
"interval": 2.0,
"reason": "business",
"peer": ["f7cb567e"],
}
}| 类型 | 说明 |
|---|---|
| telephone | 电话 |
json
{
"id":"widget1",
"type":"telephone",
"value": {
"country_code":"+86",
"national_number":"13122222222"
}
}响应体示例
json
注:不可加签给当前审批人
{
"code": 0,
"msg": "success",
"data": {
"approval_code": "7C468A54-8745-2245-9675-08B7C63E7A85",
"approval_name": "Payment",
"start_time": 1564590532967,
"end_time": 0,
"user_id": "f3ta757q",
"open_id": "ou_123456",
"serial_number":"202102060002",
"department_id": "od-8ec33ffec336c3a39a278bc25e931676",
"status": "PENDING",
"uuid": "xxxxx",
"form": "[{\"id\": \"widget1\",\"custom_id\": \"user_info\",\"name\": \"Item application\",\"type\": \"textarea\"},\"value\":\"aaaa\"]",
"task_list":[
{
"id": "1234",
"node_id": "46e6d96cfa756980907209209ec03b64",
"node_name": "开始",
"custom_node_id": "manager",
"user_id": "f7cb567e",
"open_id": "ou_123457",
"type": "AND",
"status": "PENDING",
"start_time": 1564590532967,
"end_time": 0
}
],
"comment_list": [
{
"id": "1234",
"user_id": "f7cb567e",
"open_id": "ou_123456",
"comment": "ok",
"create_time": 1564590532967
}
],
"timeline": [
{
"type": "START",
"user_id": "f8ca557e",
"open_id": "ou_123456",
"create_time": 1564590532967,
"comment": "ok",
"task_id": "1234",
"cc_user_list": [],
"ext": "{\"user_id_list\":[\"f7cb567e\"],\"open_id_list\":[\"ou_123456\"]}"
},
{
"type": "CC",
"user_id_list": [
"eea5gefe"
],
"open_id_list": [
"ou_12345"
],
"create_time": 1571913568556,
"comment": "ccc",
"ext": "{\"user_id\":\"62d4a44c\",\"open_id\":\"ou_123456\"}"
},
{
"comment": "防守打法",
"create_time": 1636616275751,
"node_key": "APPROVAL_240330_4058663",
"open_id": "ou_456",
"task_id": "789",
"type": "PASS",
"user_id": "f6bac64a"
}
]
}
}