- 自有工作流
- 官方工作流
发起审批实例
POST
http://127.0.0.1/topapi/processinstance/create
服务端API/智能工作流/官方工作流
最后修改时间:2022-08-30 09:19:22
责任人:未设置
说明#
服务地址:https://oapi.dingtalk.com
权限#
应用类型 | 是否支持调用 | 权限申请方式 | API Explorer调试 |
---|---|---|---|
企业内部应用 | 是 | 开发者后台申请 | 调试 |
第三方企业应用 | 是 | 开发者后台申请 | 调试 |
第三方个人应用 | 否 | — | — |
请求参数
Query 参数
access_token
string
必需
示例值:
6d1bxxxx
Body 参数application/json
agent_id
number
可选
process_code
string
必需
originator_user_id
string
必需
dept_id
number
必需
approvers
string
可选
approvers_v2
array [object {2}]
可选
task_action_type
string
可选
user_ids
array[string]
可选
cc_list
string
可选
cc_position
string
可选
form_component_values
array [object {3}]
必需
name
string
表单每一栏的名称。
value
string
表单每一栏的值。
ext_value
string
扩展值。
示例
{
"form_component_values": [
{
"name": "单行输入框",
"value": "测试单行输入框"
},
{
"name": "多行输入框",
"value": "测试多行输入框"
},
{
"name": "金额(元)大写",
"value": "1"
},
{
"name": "数字输入框",
"value": "100"
},
{
"name": "单选框",
"value": "a"
},
{
"name": "多选框",
"value": "[\"a\",\"b\"]"
},
{
"name": "日期",
"value": "2021-08-17"
},
{
"name": "[\"开始时间\",\"结束时间\"]",
"value": "[\"2019-02-19\",\"2019-02-25\"]"
},
{
"name": "图片",
"value": ["http://url1","http://url2","http://url3"]
},
{
"name": "附件",
"value": [{"spaceId": "163xxxx658", "fileName": "2644.JPG", "fileSize": "333", "fileType": "jpg", "fileId": "643xxxx140"}]
},
{
"name": "联系人",
"value": "[\"4525xxxxxxxx77041\"]"
},
{
"name":"关联审批单",
"value":[
"fa2aa864-xxxx-xxxx-xxxx-75572c0e2cdf",
"7125778e-xxxx-xxxx-xxxx-faa987478a9b"
]
},
{
"name": "明细",
"value": [
[
{
"name":"单行输入框",
"value":"明细单行输入框"
},
{
"name":"数字输入框",
"value":"100"
}
]
]
}
],
"agent_id": 115xxxx211,
"process_code": "PROC-37801FB3-xxxx-xxxx-xxxx-6C6ADB87CD9A",
"cc_position": "FINISH",
// "approvers": "4525xxxxxxxx77041,2643xxxxxxx69379",
"cc_list": "4525xxxxxxxx77041",
"dept_id": 70041378,
"approvers_v2": [ //设置审批人,会签、或签设置的审批人必须大于等于2个人
{
"task_action_type": "AND",
"user_ids": [
"4525xxxxxxxx77041",
"2643xxxxxxx69379"
]
},
{
"task_action_type": "OR",
"user_ids": [
"4525xxxxxxxx77041",
"2643xxxxxxx69379"
]
}
],
"originator_user_id": "4525xxxxxxxx77041"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://127.0.0.1/topapi/processinstance/create?access_token=6d1bxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"form_component_values": [
{
"name": "单行输入框",
"value": "测试单行输入框"
},
{
"name": "多行输入框",
"value": "测试多行输入框"
},
{
"name": "金额(元)大写",
"value": "1"
},
{
"name": "数字输入框",
"value": "100"
},
{
"name": "单选框",
"value": "a"
},
{
"name": "多选框",
"value": "[\"a\",\"b\"]"
},
{
"name": "日期",
"value": "2021-08-17"
},
{
"name": "[\"开始时间\",\"结束时间\"]",
"value": "[\"2019-02-19\",\"2019-02-25\"]"
},
{
"name": "图片",
"value": ["http://url1","http://url2","http://url3"]
},
{
"name": "附件",
"value": [{"spaceId": "163xxxx658", "fileName": "2644.JPG", "fileSize": "333", "fileType": "jpg", "fileId": "643xxxx140"}]
},
{
"name": "联系人",
"value": "[\"4525xxxxxxxx77041\"]"
},
{
"name":"关联审批单",
"value":[
"fa2aa864-xxxx-xxxx-xxxx-75572c0e2cdf",
"7125778e-xxxx-xxxx-xxxx-faa987478a9b"
]
},
{
"name": "明细",
"value": [
[
{
"name":"单行输入框",
"value":"明细单行输入框"
},
{
"name":"数字输入框",
"value":"100"
}
]
]
}
],
"agent_id": 115xxxx211,
"process_code": "PROC-37801FB3-xxxx-xxxx-xxxx-6C6ADB87CD9A",
"cc_position": "FINISH",
// "approvers": "4525xxxxxxxx77041,2643xxxxxxx69379",
"cc_list": "4525xxxxxxxx77041",
"dept_id": 70041378,
"approvers_v2": [ //设置审批人,会签、或签设置的审批人必须大于等于2个人
{
"task_action_type": "AND",
"user_ids": [
"4525xxxxxxxx77041",
"2643xxxxxxx69379"
]
},
{
"task_action_type": "OR",
"user_ids": [
"4525xxxxxxxx77041",
"2643xxxxxxx69379"
]
}
],
"originator_user_id": "4525xxxxxxxx77041"
}'
返回响应
🟢200成功
application/json
Body
errcode
number
返回码。
errmsg
string
返回码描述。
request_id
string
请求ID。
process_instance_id
string
审批实例ID。
示例
{
"errcode": 0,
"errmsg": "string",
"request_id": "string",
"process_instance_id": "string"
}
