通过 id 或者 username 批量查询用户信息

通过id或者username批量查询用户信息。

适用版本

企业专属版

服务接入点

获取服务接入点,替换 API 请求语法中的 {domain}

授权信息

产品

资源

所需权限

组织管理

用户

只读

请求语法

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

请求说明

根据用户userIds批量查询用户信息

curl -X 'POST' \
  'https://test-domain-***.rdc.aliyuncs.com/oapi/v1/platform/users:batchRead' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "userIds": ["99d1****6124"]
    }'

根据用户名usernames批量查询用户信息

curl -X 'POST' \
  'https://test-domain-***.rdc.aliyuncs.com/oapi/v1/platform/users:batchRead' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "usernames": ["testUsername"]
    }'

请求头(Headers)

x-yunxiao-token string (必选)

个人访问令牌。您可参考个人访问令牌获取。

示例:pt-0fh3****0fbG_35af****0484。

请求参数

userIds array[string](可选)

用户 ID 列表。userIdsusernames只能传入一个,但不能同时为空。

usernames array[string](可选)

用户名。userIdsusernames只能传入一个,但不能同时为空。

返回参数

返回示例

[
    {
        "email": "test****@example.com",
        "id": "99d1****6124",
        "lastOrganization": "99d1****6124",
        "name": "示例用户名",
        "staffId": "123****",
        "sysDeptIds": ["99d1****6124"],
        "username": "demo**username"
        "createdAt": "2025-01-20T10:25:56Z"
    }
]

email string

邮箱。

createdAt string

创建时间。

id string

用户 ID。

lastOrganization string

上次登录组织。

name string

显示名称。

staffId string

工号。

sysDeptIds array[string]

所属部门。

username string

登录账号名。

错误码

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