Help Center/ CodeArts Req/ API Reference/ APIs/ User Information/ Obtains the current user information.
Updated on 2023-06-12 GMT+08:00

Obtains the current user information.

Function

Obtains the current user information.

URI

GET /v4/user

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies a user token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Minimum: 10

Maximum: 32768

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

domain_id

String

Tenant ID

domain_name

String

Tenant Name

user_num_id

Integer

User ID

user_id

String

Specifies the user ID.

user_name

String

User Name

nick_name

String

Nickname of the user.

created_time

Long

Created

updated_time

Long

Update time.

gender

String

Gender

user_type

String

User type, User: cloud user, Federation Account,

Status code: 400

Table 3 Response body parameters

Parameter

Type

Description

error_msg

String

Description

error_code

String

Error Codes

Status code: 401

Table 4 Response body parameters

Parameter

Type

Description

error_msg

String

Description

error_code

String

Error Codes

Example Requests

Get https://{endpoint}/v4/user

Get https://{endpoint}/v4/user

Example Responses

Status code: 200

OK

{
  "domain_id" : "4e919d73499648e3b0292cd3cbef806a",
  "domain_name" : "demo_user_name",
  "user_num_id" : "4060",
  "user_id" : "a360371833bf4c558f796fd707b44daf",
  "user_name" : "demo_user_name",
  "nick_name" : "",
  "created_time" : "1562318865000",
  "updated_time" : "1598074854000",
  "gender" : "male",
  "user_type" : "User"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.