接口说明
- 查询项目或部门在滴滴侧的具体信息
- 通过获取的信息用于确认相关的配置信息,可以用于同步滴滴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 项目 |
budget_cycle |
预算周期 |
int |
枚举值数字 0 不限期 1 自然月 2 自然季度 3 自然年 |
out_budget_id |
外部成本中心id |
string |
|
total_quota |
总金额 |
number |
单位元 0 表示不限额度 精确到两位小数 |
is_limit_quota |
是否限额 |
int |
枚举值数字 0 不限制 1 限制 |
member_num |
在使用人数 |
int |
|
available_quota |
可用金额 |
number |
单位元 精确到两位小数 |
freeze_quota |
冻结金额 |
number |
单位元 精确到两位小数 |
leader_id |
主管 |
string |
|
leader_item_list |
主管列表 |
array |
|
parent_id |
上级部门或项目的id |
int |
|
member_used |
使用范围 |
int |
枚举值数字 0 全员可见 1 项目成员可见 2 公司主体可见 |
start_date |
项目开始日期 |
string |
当类型为项目时,此参数有效 格式:yyyy-MM-dd |
expiry_date |
项目结束日期 |
string |
当类型为项目时,此参数有效 格式:yyyy-MM-dd,0为长期有效 |
legal_entity_id |
公司主体ID |
string |
多个英文逗号分开 |
budget_extra_info |
项目拓展字段 |
string |
项目拓展字段,仅项目有数据时返回 |
leader_item_list
字段名 |
字段说明 |
字段类型 |
备注 |
---|---|---|---|
leader_id |
主管ID |
string |
|
leader_name |
主管姓名 |
string |
|
leader_type |
主管类型 |
string |
枚举英文:major 主要主管 other 其他主管 |
响应示例
正常示例
{
"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",
"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"
}
]
}
}
异常示例
错误码
-
4xx 错误
-
1xxx 错误
版本记录
日期 |
更新人 |
更新内容 |
上线时间 |
---|---|---|---|
2023.11.07 |
陈继诗 |
迁移文档 |
|
2023.12.08 |
陈继诗 |
records数组增加budget_extra_info |
2024.01.04 |
2024.07.23 |
陈继诗 |
增加leader_item_list |
2024.08.22 |