创建审批实例
POST
https://open.feishu.cn/open-apis/approval/v4/instances
自建应用商店应用
控件值说明
单行文本
{
"id": "widget1",
"type": "input",
"value": "data"
}
多行文本
{
"id": "widget1",
"type": "textarea",
"value": "data"
}
日期
value 满足 RFC3339 格式,
{
"id": "widget1",
"type": "date",
"value": "2019-10-01T08:12:01+08:00"
}
单选
{
"id": "widget1",
"type": "radio",
"value": "optionA"
}
{
"id": "widget1",
"type": "radioV2",
"value": "k2b8mkx0-h71x5gljn3i-1"
}
数字
{
"id": "widget1",
"type": "number",
"value": 1234.5678
}
金额
{
"id": "widget1",
"type": "amount",
"value": 1234.5678,
"currency":"USD"
}
计算公式
{
"id": "widget1",
"type": "formula",
"value": 1234.5678
}
联系人
{
"id":"widget1",
"type":"contact",
"value": ["f8ca557e"],
"open_ids": ["ou_12345"]
}
关联审批
{
"id":"widget1",
"type":"connect",
"value": ["19EAC829-F1CB-527F-BE2A-1330422E60C0"]
}
附件
{
"id":"widget1",
"type":"attachment",
"value": ["D93653C3-2609-4EE0-8041-61DC1D84F0B5"]
}
{
"id":"widget1",
"type":"attachmentV2",
"value": ["D93653C3-2609-4EE0-8041-61DC1D84F0B5"]
}
图片
{
"id":"widget1",
"type":"image",
"value": ["D93653C3-2609-4EE0-8041-61DC1D84F0B5"]
}
多选
{
"id":"widget1",
"type":"checkbox",
"value": ["optionA"]
}
{
"id":"widget1",
"type":"checkboxV2",
"value": ["k2b8mkx0-h71x5gljn3i-1"]
}
日期区间
{
"id": "widget1",
"type": "dateInterval",
"value": {
"start":"2019-10-01T08:12:01+08:00",
"end":"2019-10-02T08:12:01+08:00",
"interval": 2.0
}
}
明细
{
"id": "widget1",
"type": "fieldList",
"value": [
[
{
"id": "widget1",
"type": "checkbox",
"value": ["jxpsebqp-0"]
}
]
]
}
部门
{
"id":"widget1",
"type":"department",
"value":[
{
"open_id":"od-xxx"
}
]
}
电话
{
"id":"widget1",
"type":"telephone",
"value": {
"countryCode":"+86",
"nationalNumber":"13122222222"
}
}
换班控件组
{
"id": "widget1",
"type": "shiftGroup",
"value": {
"shiftTime": "2019-10-01T08:12:01+08:00",
"returnTime": "2019-10-02T08:12:01+08:00",
"reason": "ask for leave"
}
}
不支持开放平台创建的类型
控件 | 类型 |
---|---|
地址 | address |
出差控件组 | tripGroup |
请假控件组 | leaveGroup |
加班控件组 | workGroup |
补卡控件组 | remedyGroup |
外出控件组 | outGroup |
电子签章 | signGroup |
错误码
HTTP状态码 | 错误码 | 描述 | 排查建议 |
---|---|---|---|
400 | 1390001 | param is invalid | 参数错误 |
400 | 1390015 | approval is not active | 审批定义已停用,检查审批定义是否启用 |
400 | 1390013 | unsupported approval for free process | 不支持自由流程 |
400 | 1395001 | There have been some errors. Please try again later | 服务出现错误,请稍候再试 |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://open.feishu.cn/open-apis/approval/v4/instances' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"approval_code":"4202AD96-9EC1-4284-9C48-B923CDC4F30B",
"user_id":"59a92c4a",
"open_id":"ou_806a18fb5bdf525e38ba219733bdbd73",
"form":"[{\"id\":\"111\",\"type\":\"input\",\"value\":\"11111\"},{\"id\":\"222\",\"required\":true,\"type\":\"dateInterval\",\"value\":{\"start\":\"2019-10-01T08:12:01+08:00\",\"end\":\"2019-10-02T08:12:01+08:00\",\"interval\": 2.0}},{\"id\":\"333\",\"type\":\"radioV2\",\"value\":\"1\"},{\"id\":\"444\",\"type\":\"number\", \"value\":\"4\"},{\"id\":\"555\",\"type\":\"textarea\",\"value\":\"fsafs\"}]",
"node_approver_user_id_list":[
{"key": "46e6d96cfa756980907209209ec03b64","value":["59a92c4a"]},
{"key": "manager_node_id","value":["59a92c4a"]}
],
"node_approver_open_id_list":[
{"key": "46e6d96cfa756980907209209ec03b64","value":["ou_806a18fb5bdf525e38ba219733bdbd73"]},
{"key": "manager_node_id","value":["ou_806a18fb5bdf525e38ba219733bdbd73"]}
],
"node_cc_user_id_list":[
{"key": "46e6d96cfa756980907209209ec03b64","value":["59a92c4a"]},
{"key": "manager_node_id","value":["59a92c4a"]}
],
"node_cc_open_id_list":[
{"key": "46e6d96cfa756980907209209ec03b64","value":["ou_806a18fb5bdf525e38ba219733bdbd73"]},
{"key": "manager_node_id","value":["ou_806a18fb5bdf525e38ba219733bdbd73"]}
]
}'
响应示例响应示例
{
"code": 0,
"msg": "success",
"data": {
"instance_code": "81D31358-93AF-92D6-7425-01A5D67C4E71"
}
}
请求参数
Header 参数
Authorization
string
必需
默认值:
Bearer {{access_token}}
Content-Type
string
必需
默认值:
application/json; charset=utf-8
Body 参数application/json
返回响应
修改于 2023-01-28 10:20:31