GetUserByToken - Query user information by personal access token

Updated at:

This topic describes how to use OpenAPI to query user information with a personal access token.

Applicable editions

Central edition, Region edition

Endpoints and authorization information

  • Obtain the endpoint. Replace {domain} in the API request syntax.

  • Obtain a personal access token.

  • Obtain the organizationId. This is required only for the Central edition. Go to the Basic Information page in the Tennant Management console to obtain the organization ID.

Product

Resource

Required permission

Organization Management

User

Read-only

Request syntax

Central edition

GET https://{domain}/oapi/v1/platform/user

Region edition

GET https://{domain}/oapi/v1/platform/user

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

Personal access token.

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

Request examples

Central edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/platform/user' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/platform/user' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example

-

object

createdAt

string

The time when the user was created.

2023-03-22T12:44:50.048Z

deletedAt

string

The time when the user was deleted.

2023-03-22T12:44:50.048Z

email

string

The mailbox.

test****@example.com

id

string

The user ID.

99d1****6124

lastOrganization

string

The organization where the user last logged on.

99d1****6124

name

string

The display name.

ExampleUsername

nickName

string

The nickname.

ExampleNickname

staffId

string

The employee ID.

123****

sysDeptIds

array[string]

The department to which the user belongs.

["99d1****6124"]

username

string

The logon account name.

demo**username

Response example

{
    "createdAt": "2023-03-22T12:44:50.048Z",
    "deletedAt": "2023-03-22T12:44:50.048Z",
    "email": "test****@example.com",
    "id": "99d1****6124",
    "lastOrganization": "99d1****6124",
    "name": "ExampleUsername",
    "nickName": "ExampleNickname",
    "staffId": "123****",
    "sysDeptIds": ["99d1****6124"],
    "username": "demo**username"
}

Error codes

For more information about API error codes, see the Error Code Center.