新增

请求地址

https://api.es.xiaojukeji.com/river/BudgetCenter/add

返回数据格式

JSON

请求方式

POST

是否需要登录

是 关于登录授权,参见 如何登录授权

访问授权限制

暂无

请求参数

名称 类型 必选 描述
client_id string yes 申请应用时分配的AppKey
access_token string yes 授权后的access token
timestamp bigint yes 当前时间戳,精确到秒级
company_id string yes 企业ID
sign string(32) yes 签名
name string yes 名称
type int yes 类型(1部门 2项目)
budget_cycle int yes 预算周期(0不限期;1自然月)
total_quota float yes 总金额(0表示不限额度,单位元,小数点后保留两位精度)
out_budget_id string no 编号(部门为必填,项目为选填)
leader_id string no 主管,通过员工-详情API获得对应id
parent_id string no 上级部门或项目的id(部门为选填,默认为顶级部门的id;项目为选填)
member_used int no 是否仅项目成员可用(0不是;1是)默认为0;当类型为项目时,此参数有效
start_date string no 项目开始日期(格式举例:2018-01-02),可以为空;当类型为项目时,此参数有效
expiry_date string no 项目结束日期(格式举例:2018-01-02),可以为空;当类型为项目时,此参数有效

注意事项

  1. 部门数量上限是2000,如贵司超过2000个部门,请联系相应的对接同学添加白名单进行扩展
  2. 部门添加时,请不要并发操作,防止部门添加失败
  3. 请求时无需中文转义

请求示例

curl -X POST -H "content-type:application/json" \
-d '{"client_id":"client_id_test","access_token":"1e79178d3bfeb40be24404a3048f541f34dd6268","timestamp":1583484681,"company_id":"12345678980","name":"\u56fd\u5e86\u884c\u52a8","type":2,"budget_cycle":1,"total_quota":0,"sign":"b517f48fcbe57a2d66dcefd560452da1"}' \
https://api.es.xiaojukeji.com/river/BudgetCenter/add

返回参数说明

名称 类型 描述
errno string 0表示成功,非0表示失败
errmsg string errno=0时为常量"SUCCESS",errno!=0时为错误信息
data object 部门或项目数据
data.id string 部门或项目id

返回示例

{
    "errno":0,
    "errmsg":"success",
    "data":{
        "id":"6415496924215922706"
    }
}

接口错误解决方案

通用错误解决文档

  1. 4xx 错误
  2. 1xxx 错误

results matching ""

    No results matching ""