文档

CreateSysDept - 创建企业部门

更新时间:

通过 OpenAPI 创建企业部门。

适用版本

企业专属版

服务接入点与授权信息

请求语法

POST  https://<domain>/oapi/v1/platform/departments

请求头

参数

类型

是否必填

描述

示例值

x-yunxiao-token

string

个人访问令牌。

pt-0fh3****0fbG_35af****0484

请求参数

参数

类型

位置

是否必填

描述

示例值

name

string

body

部门名称。

组织部门

operatorId

string

body

使用非个人访问令牌如应用访问令牌调用时,需指定操作人。

parentId

string

body

父部门 ID。

f5b8****7a1c

请求示例

curl -X 'POST' \
  'https://test.rdc.aliyuncs.com/oapi/v1/platform/departments' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  -d '{
  "name": "组织部门",
  "operatorId": "string",
  "parentId": "f5b8****7a1c"
}'

返回参数

参数

类型

描述

示例值

creatorId

string

创建者 ID。

0ef2****104b

hasSub

boolean

是否有子部门。

true

id

string

部门 ID。

8446****ce9f

name

string

名称。

组织部门

parentId

string

父部门 ID。

f5b8****7a1c

type

string

类型。

返回示例

 {
    "creatorId": "0ef2****104b",
    "hasSub": true,
    "id": "8446****ce9f",
    "name": "组织部门",
    "parentId": "f5b8****7a1c",
    "type": ""
 }

错误码

访问错误码中心查看 API 相关错误码。