Batch query user information

更新时间:
复制 MD 格式

Queries information for multiple users by user id or username.

Supported editions

Enterprise Dedicated Edition

Service endpoints

Get the service endpoint and replace {domain} in the API request syntax with your endpoint .

Authorization information

Product

Resource

Required permission

Organization Management

User

Read-only

Request syntax

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

Request

By 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"]
    }'

By 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"]
    }'

Request headers

x-yunxiao-token string (Required)

The access token. See Access token for details.

Example: pt-0fh3****0fbG_35af****0484.

Request parameters

userIds array[string](Optional)

A list of user IDs. You must specify either userIds or usernames, but not both.

usernames array[string](Optional)

A list of usernames. You must specify either userIds or usernames, but not both.

Response parameters

Sample response

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

email string

The user's email address.

createdAt string

The time the account was created.

id string

The user ID.

lastOrganization string

The ID of the organization that the user last accessed.

name string

The display name of the user.

staffId string

The employee ID.

sysDeptIds array[string]

The IDs of the departments to which the user belongs.

username string

The user's login name.

Error codes

For more information, see Error codes.