批量同步接口

  • 接口:common/assetTypes/v2/batch
  • Method:POST
  • 数据格式:JSON
  • 限流信息:150次每天和50次每小时
  • 多语言环境:在接口请求头中添加Key为locale,Value值为语言环境,目前支持的语言有zh_CN(中文)、en_US(英文)、ja_JP(日文)、zh_TW(繁体),请选取其中一种
  • 接口说明:该接口用作资产类别的批量同步(根据code是否存在判断新增/更新),在整批数据中如果只有几条数据因为其他原因失败,那么只有这几条数据不会被处理,其他数据仍会被正常处理
  • 其他补充信息:该接口用作资产类别的批量同步(根据code是否存在判断新增/更新),在整批数据中如果只有几条数据因为其他原因失败,那么只有这几条数据不会被处理,其他数据仍会被正常处理

    参数:

请求参数

字段名称 字段类型 字段描述 是否必填 长度限制(字节)
bizId String 当前次接口同步的唯一标识 TRUE 36
timestamp long 当前次接口同步对应的时间戳 TRUE 13
data Array 当前次接口同步的数据集合 TRUE
data.code String 资产类别编码 TRUE 64
data.type_name String 资产类别名称 TRUE 64
data.parent_code String 父类编码(不传或者传空会默认根节点) FALSE 64
data.description String 描述 FALSE 64
data.default_use_life int 默认使用寿命 FALSE 0
data.enabled_flag String 用户启用标志(Y/N,默认为Y) FALSE 1

返回参数

字段名称 字段类型 字段描述
bizId String 当前次接口同步的唯一标识
resCode Integer 响应状态码(见附录)
resMsg String 返回信息描述
created String 创建成功的条数
updated String 更新成功的条数
validatorErrors Array 字段强校验不合格的数据
dbErrors Array 数据持久化时出现错误的数据
warnings Array 字段弱校验不合格的数据,任会做同步处理

示例:

请求数据

{
  "timestamp": 1665976598000,
  "bizId": "xxx",
  "data": [
    {
      "code": "typeCode",
      "enabled_flag": "N",
      "parent_code": "code11111",
      "type_name": "资产类型",
      "description": "资产类型描述N"
    }
  ]
}

返回数据

{
  "resCode": 200000,
  "resMsg": "success",
  "bizId": "xxx",
  "data": {
    "validatorErrors": [],
    "created": "此次请求新建成功了0条数据",
    "warnings": [
      {
        "code": "typeCode",
        "messages": [
          "上级编码code11111不存在, 默认重置为根节点类型"
        ]
      }
    ],
    "dbErrors": [],
    "updated": "此次请求更新成功了1条数据"
  }
}

results matching ""

    No results matching ""