Updated on 2023-07-18 GMT+08:00

Querying IAM User Details

Function

This API can be used by the administrator to query the details about a specified IAM user or used by an IAM user to query their own details.

The API can be called using both the global endpoint and region-specific endpoints. For IAM endpoints, see Regions and Endpoints.

Restrictions

This API cannot be used to query the mobile number and email address of an IAM user. To query such information, see Querying IAM User Details (Recommended).

URI

GET /v3/users/{user_id}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

user_id

Yes

String

IAM user ID. For details about how to obtain a user ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

Request Parameters

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Fill application/json;charset=utf8 in this field.

X-Auth-Token

Yes

String

If the administrator is requesting to query IAM user details, see Actions.

If an IAM user is requesting to query their own details, the user token (no special permission requirements) of the user is required.

Response Parameters

Table 3 Parameters in the response body

Parameter

Type

Description

user

Object

IAM user information.

Table 4 user

Parameter

Type

Description

name

String

IAM user name.

links

Object

IAM user resource link information.

domain_id

String

ID of the account to which the IAM user belongs.

enabled

Boolean

Enabling status of the IAM user. true (default value) indicates that the user is enabled. false indicates that the user is disabled.

id

String

IAM user ID.

password_expires_at

String

Password expiration time of the IAM user. If this parameter is set to null, the password will never expire.

NOTE:

The value is a UTC time in the YYYY-MM-DDTHH:mm:ss.ssssssZ format, for example, 2023-06-28T08:56:33.710000Z. For details about the date and timestamp formats, see ISO-8601.

description

String

Description of the user.

pwd_status

Boolean

Password status. true means that the password needs to be changed, and false means that the password is normal.

last_project_id

String

ID of the project that the IAM user lastly accessed before exiting the system.

Example Request

Request for querying IAM user details, excluding the mobile number and email address of the IAM user

GET https://iam.myhuaweicloud.com/v3/users/{user_id}

Example Response

Status code: 200

The request is successful.

{
    "user": {
        "pwd_status": true,
        "domain_id": "d78cbac186b744899480f25bd02...",
        "last_project_id": "065a7c66da0010992ff7c0031e5a5...",
        "name": "IAMUser",
        "description": "--",
        "password_expires_at": null,
        "links": {
            "next": null,
            "previous": null,
            "self": "https://iam.myhuaweicloud.com/v3/users/07609fb9358010e21f7bc003751..."
        },
        "id": "7116d09f88fa41908676fdd4b039...",
        "enabled": true
    }
}

Status Codes

Status Code

Description

200

The request is successful.

400

Invalid parameters.

401

Authentication failed.

403

Access denied.

404

The requested resource cannot be found.

405

The method specified in the request is not allowed for the requested resource.

413

A resource conflict occurs.

500

Internal server error.

503

Service unavailable.

Error Codes

None