CreateUser - 创建用户

创建用户。

服务接入点与授权信息

产品 资源 所需权限
基础服务 用户 读写

请求语法

POST https://{domain}/oapi/v1/platform/users

请求头

参数 类型 是否必填 描述 示例值
x-yunxiao-token string 个人访问令牌。 pt-0fh3****0fbG_35af****0484

请求参数

参数 类型 位置 是否必填 描述 示例值
- object body
      email string body 邮箱。 test**@example.com
      name string body 显示用户名。 示例用户名
      nickName string body 昵称。 示例昵称
      operatorId string body 使用非个人访问令牌如应用访问令牌调用时,需指定操作人。 99d1**6124
      password string body 密码。 Yun**@0123
      staffId string body 工号。 123**
      sysDeptIds array[string] body 所属部门,为空时加入根部门。 [99d1**6124]
      username string body 登录账号名。 demo**username

请求示例

curl -X 'POST' \
  'https://test.rdc.aliyuncs.com/oapi/v1/platform/users' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "email": "test****@example.com",
        "name": "示例用户名",
        "nickName": "示例昵称",
        "operatorId": "99d1****6124",
        "password": "Yun****@0123",
        "staffId": "123****",
        "sysDeptIds": [99d1****6124],
        "username": "demo**username"
    }'

返回参数

参数 类型 描述 示例值
- object
      email string 邮箱。 test**@example.com
      id string 用户 ID。 99d1**6124
      lastOrganization string 上次登录组织。 99d1**6124
      name string 显示名称。 示例用户名
      nickName string 昵称。 示例昵称
      staffId string 工号。 123**
      sysDeptIds array[string] 所属部门。 [99d1**6124]
      username string 登录账号名。 demo**username

返回示例

{
    "email": "test****@example.com",
    "id": "99d1****6124",
    "lastOrganization": "99d1****6124",
    "name": "示例用户名",
    "nickName": "示例昵称",
    "staffId": "123****",
    "sysDeptIds": [99d1****6124],
    "username": "demo**username"
}

错误码

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

results matching ""

    No results matching ""