# 接口说明
- 1.如果有审批业务,则需要进行通过该接口创建申请用车审批单
注意:新用车审批接口在创建审批单时,需传递审批用车规则ID给分贝通,若不传递则分贝通会查询该员工是否有审批用车规则,若没有则该审批单不限制用车标准,同时使用该审批单叫车将不会参与分贝通节省奖励活动。
| 请求方式 | 请求地址 |
|---|---|
| POST | /openapi/func/apply/car/create |
| 字段 | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| access_token | token | string | Y | 登录 token |
| sign | 签名 | string | Y | oihfnlyeofdh98 |
| timestamp | 时间戳 | long | Y | 13位时间戳 1241243250000 |
| employee_id | 用户ID | string | Y | 分贝用户id或者第三方用户id,为创建人的ID |
| employee_type | 用户类型 | string | Y | 类型,0为分贝用户,1为第三方用户 |
| data | 请求数据 | jsonobject | Y | 请求数据 |
| data.apply | 申请单内容 | jsonobject | Y | 申请单详细内容 |
| data.apply.type | 申请单业务类型 | integer | Y | 12 审批用车 |
| data.apply.apply_reason | 申请事由 | String | N | 申请事由,不能超过200字符 |
| data.apply.flow_type | 审批类型 | integer | Y | 固定为4 |
| data.apply.third_id | 申请单id | string | Y | 第三方审批单id,不可重复 |
| data.apply.third_remark | 第三方备注 | string | Y | 详细备注信息 |
| data.apply.cost_attribution_list | 费用归属对象集合 | jsonarray | N | 费用归属对象集合 |
| data.apply.cost_attribution_list.cost_attribution_id | 费用归属id | string | N | 部门ID或项目ID,当传递费用归属时,费用归属三个属性必须同时传递,否则无法识别 |
| data.apply.cost_attribution_list.cost_attribution_name | 费用归属name | string | N | 部门名称或项目名称,当传递费用归属时,费用归属三个属性必须同时传递,否则无法识别 |
| data.apply.cost_attribution_list.cost_attribution_category | 费用归属类型 | integer | N | 1.部门 2.项目 当传递费用归属时,费用归属三个属性必须同时传递,否则无法识别 |
| data.apply.new_cost_attributions | (新)费用归属对象集合 | jsonarray | N | (新)费用归属对象集合 |
| data.apply.new_cost_attributions.type | (新)费用归属类型 | Integer | N | (新)费用归属类型1.部门 2.项目,3自定义档案 |
| data.apply.new_cost_attributions.third_archive_id | (新)三方自定义档案id | string | N | 三方自定义档案id(type为3时必传) |
| data.apply.new_cost_attributions.archive_name | (新)自定义档案名称 | string | N | 自定义档案名称(type为3时必传) |
| data.apply.new_cost_attributions.details | (新)费用归属详情 | jsonArray | N | (新)费用归属详情 |
| data.apply.new_cost_attributions.details.third_id | (新)三方费用归属id | string | N | 费用归属类型(type)为1时,该字段值为部门三方id;费用归属类型(type)为2时,该字段为项目三方ID;费用归属类型(type)为3时,该字段值为自定义档案项目三方ID |
| data.apply.new_cost_attributions.details.name | (新)费用归属名称 | string | N | 费用归属类型(type)为1时,该字段值为部门name;费用归属类型(type)为2时,该字段为项目name;费用归属类型(type)为3时,该字段值为自定义档案项目name |
| data.apply.rule_id | 规则ID | string | N | 根据公司ID查询规则信息。如果传递,则取rule_id内容 |
| data.trip_list | 行程列表 | jsonarray | Y | 行程列表(⚠️ 目前仅支持一个行程) |
| data.trip_list.type | 业务类型 | integer | Y | 用车类型 3.用车 |
| data.trip_list.start_city_id | 用车城市ID | string | Y | 城市ID 如:北京:100001,根据城市接口获取,多城市时将城市id用逗号分割 |
| data.trip_list.start_time | 出发时间 | string | Y | 行程开始日期 2019-12-13 |
| data.trip_list.end_time | 结束时间 | string | Y | 行程结束日期 2019-12-23 |
| data.custom_fields | 自定义字段 | jsonarray | N | 审批单自定义字段 |
| data.custom_fields.type | 自定义字段类型 | string | N | 与配置表字段key匹配 |
| data.custom_fields.value | 自定义字段值 | string | N | 审批单自定义字段值 |
请求示例:
"access_token":"5747fbc10f0e60e0709d8d722",
"timestamp":1635820323000,
"sign":"oihfnlyeofdh98",
"employee_id":"59b74c1323445f2d54dd07922",
"employee_type":"1",
"data":
{
"apply": {
"apply_reason":"",
"type": 12,
"flow_type": 4,
"third_id": "57613c455eac323d0c17",
"third_remark": "",
"new_cost_attributions":[
{
"type":"1",
"third_archive_id":"5f361f6523445f0f90a7a8db",
"archive_name":"xxx",
"details":[
{
"third_id":"5f361f652323223445f0f90a7a8db",
"name":"xxx"
}
]
}
],
"cost_attribution_list": [{
"cost_attribution_id": "od-2fd01a3037c27fff0cba7a34d1c2bb07",
"cost_attribution_name": "开放平台",
"cost_attribution_category": 1
},
{
"cost_attribution_id": "5a66b2c1235f2417491280",
"cost_attribution_name": "test1",
"cost_attribution_category": 2
}
]
},
"rule_id": 1212,
"trip_list": [{
"type": 3,
"start_city_id": "1000001",
"start_time": "2019-09-25",
"end_time": "2019-09-25"
}],
"custom_fields": [{
"type": "0",
"value": "111"
}]
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
响应结果:
{
"request_id": "99dBfiy0SJ2PJitI",
"code": 0,
"type": 0,
"msg": "success",
"data": {
"id": "5d9ea45423445f38ef3d7fdd"
}
}
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11