接口说明
- 查询项目或部门在滴滴侧的具体信息
- 通过获取的信息用于确认相关的配置信息,可以用于同步滴滴ES后台的信息,只能查询有效的部门。需要查询全部的状态。没有启用接口,过期时间修改逻辑需要确认。
基本信息
|
HTTP URL |
/river/BudgetCenter/get |
|---|---|
|
HTTP Method |
GET |
|
权限要求 |
|
请求头
|
参数名称 |
参数值 |
|---|---|
|
Content-Type |
application/x-www-form-urlencoded |
请求参数
|
字段名 |
字段说明 |
字段类型 |
必填 |
备注 |
|---|---|---|---|---|
|
client_id |
申请应用时分配的AppKey |
string |
Y |
|
|
access_token |
授权后的access token |
string |
Y |
|
|
company_id |
企业ID |
string |
Y |
|
|
timestamp |
当前时间戳(精确到秒级) |
int |
Y |
|
|
sign |
签名 |
string |
Y |
|
|
id |
滴滴内部项目或部门的ID |
string |
N |
|
|
out_budget_id |
外部成本中心id |
string |
N |
使用时与id字段择一即可 |
|
type |
类型 |
int |
N |
枚举值数字 1 部门 2 项目,不请求时,默认为全部 |
|
is_exact_name |
是否精确查询名称 |
int |
N |
枚举值数字 0 否,1 是,不请求时,默认为 0 否 |
|
name |
名称 |
string |
N |
请求的项目名称或部门名称 ID和名称择一请求 |
|
offset |
数据开始位置 |
int |
Y |
|
|
length |
数据条数(最大100条) |
int |
Y |
|
请求示例
curl -X GET -H "Content-Type: application/x-www-form-urlencoded" https://api.es.xiaojukeji.com/river/BudgetCenter/get?client_id=client_id_test&access_token=141ea31466478eab2f1c1ddcca2675b989a16552×tamp=1566764837&id=1125904357323169&company_id=12345678980&offset=0&length=100&sign=fba8dfb887afe16cb71c50b26a5eae0e
响应参数
|
字段名 |
字段说明 |
字段类型 |
备注 |
|---|---|---|---|
|
errno |
错误编码 |
string |
数字 0 表示成功,非0 表示失败 |
|
errmsg |
错误信息 |
string |
errno=0时为常量"SUCCESS",errno!=0时为错误信息 |
|
data |
部门/项目列表信息 |
object |
|
data数据格式
|
字段名 |
字段说明 |
字段类型 |
备注 |
|---|---|---|---|
|
total |
此次查询符合条件的部门或项目总数 |
int |
|
|
records |
部门或者项目集合 |
array |
|
records数组元素格式
|
字段名 |
字段说明 |
字段类型 |
备注 |
|---|---|---|---|
|
id |
滴滴内部项目或部门的ID |
string |
|
|
name |
名称 |
string |
|
|
type |
类型 |
int |
枚举值数字 1 部门 2 项目 |
|
status |
状态 |
string |
枚举值数字 1 启用中 2停用 3删除 |
|
budget_cycle |
预算周期 |
int |
枚举值数字 0 不限期 1 自然月 2 自然季度 3 自然年 |
|
out_budget_id |
外部成本中心id |
string |
|
|
is_limit_quota |
是否限额 |
int |
枚举值数字 0 不限制 1 限制 |
|
total_quota |
限额 |
number |
单位元 0 表示不限额度 精确到两位小数 |
|
member_num |
在使用人数 |
int |
|
|
available_quota |
剩余额度 |
number |
单位元 精确到两位小数 |
|
freeze_quota |
冻结金额 |
number |
单位元 精确到两位小数 |
|
leader_id |
主管 |
string |
|
|
leader_item_list |
主管列表 |
array |
|
|
parent_id |
上级部门或项目的id |
long |
|
|
out_parent_id |
上级部门或项目的编码 |
string |
上级部门或项目的外部编码,可以为空 |
|
member_used |
使用范围 |
int |
枚举值数字 0 全员可见 1 项目成员可见 2 公司主体可见 |
|
start_date |
项目开始日期 |
string |
当类型为项目时,此参数有效 格式:yyyy-MM-dd |
|
expiry_date |
项目结束日期 |
string |
当类型为项目时,此参数有效 格式:yyyy-MM-dd,0为长期有效 |
|
legal_entity_id |
公司主体ID |
string |
多个英文逗号分开 |
|
out_legal_entity_id |
公司主体编码 |
string |
多个英文逗号分开,公司主体的外部编码,顺序与legal_entity_id对应,若为空,举例:XXXX,,XXXX,第二个直接空值展示 |
|
budget_extra_info |
项目拓展字段 |
string |
项目拓展字段,仅项目有数据时返回 |
|
limit_rule_list |
限额规则列表 |
array |
|
leader_item_list
|
字段名 |
字段说明 |
字段类型 |
备注 |
|---|---|---|---|
|
leader_id |
主管ID |
string |
|
|
leader_name |
主管姓名 |
string |
|
|
leader_type |
主管类型 |
string |
枚举英文:major 主要主管 other 其他主管 |
limit_rule_list
|
字段名 |
字段说明 |
字段类型 |
备注 |
|---|---|---|---|
|
rule_name |
限额规则名称 |
string |
限额规则员工侧展示名称 |
|
budget_cycle |
预算周期 |
int |
枚举值数字 0:不限额;1:自然月;2:自然季度;3:自然年;4:一次性 |
|
is_accumulative |
是否累计 |
int |
0 不可累计 1 可累计 |
|
total_quota |
限额 |
number |
单位元 0 表示不限额度 精确到两位小数 |
|
limit_management_scope |
限额管理范围 |
int |
0 对当前部门/项目生效 1 对当前和下级部门/项目生效 |
|
available_quota |
剩余额度 |
number |
单位元 精确到两位小数 |
|
freeze_quota |
冻结金额 |
number |
单位元 精确到两位小数 |
响应示例
正常示例
{
"errno": 0,
"errmsg": "SUCCESS",
"data": {
"total": 32,
"records": [
{
"id": "6388733755640532997",
"name": "openapi1452169149",
"company_id": "4591398120721764364",
"status": "0",
"out_budget_id": "0",
"type": "1",
"budget_cycle": "1",
"is_limit_quota": "1",
"member_num": "0",
"total_quota": "1000.00",
"available_quota": "1000.00",
"parent_id": "1125968274945260",
"legal_entity_id": "",
"out_legal_entity_id": "",
"out_parent_id": "",
"budget_extra_info": "{\"test\":\"test1\"}",
"leader_item_list": [
{
"leader_id": "1125935173600502",
"leader_name": "郭蒙3",
"leader_type": "major"
},
{
"leader_id": "1125935066392161",
"leader_name": "郭蒙1",
"leader_type": "other"
},
{
"leader_id": "1125935140823459",
"leader_name": "郭蒙2",
"leader_type": "other"
}
],
"freeze_quota": "0.00",
"limit_rule_list": [
{
"rule_name": "成本中心限额(默认)",
"budget_cycle": 4,
"is_accumulative": 0,
"total_quota": 100.99,
"limit_management_scope": 0,
"available_quota": 100.99,
"freeze_quota": 0
}
]
}
]
}
}
异常示例
错误码
-
4xx 错误
-
1xxx 错误
版本记录
|
日期 |
更新人 |
更新内容 |
上线时间 |
|---|---|---|---|
|
2023.11.07 |
陈继诗 |
迁移文档 |
|
|
2023.12.08 |
陈继诗 |
records数组增加budget_extra_info |
2024.01.04 |
|
2024.07.23 |
陈继诗 |
增加leader_item_list |
2024.08.22 |
|
2025.06.18 |
杨露佳 |
新增out_legal_entity_id,out_parent_id |
2025.06.18 |
|
2026.02.09 |
郭相均、谢朱莉 |
限额相关升级 |
2026.02.09 |