调用GetUser查询RAM用户的详细信息。

本文将提供一个示例,查询RAM用户test@example.onaliyun.com的详细信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String GetUser

要执行的操作。取值:GetUser

UserPrincipalName String test@example.onaliyun.com

RAM用户的登录名称。

格式为<username>@<AccountAlias>.onaliyun.com,其中<username>为RAM用户名称,<AccountAlias>.onaliyun.com为默认域名。

UserPrincipalName长度为1~128个字符,可包含英文字母、数字、半角句号(.)、短划线(-)和下划线(_)。其中<username>的长度为1~64个字符。

说明 必须指定 UserPrincipalNameUserIdUserAccessKeyId三个参数中的一个参数,但不能同时指定。
UserId String 20732900249392****

RAM用户ID。

说明 必须指定 UserPrincipalNameUserIdUserAccessKeyId三个参数中的一个参数,但不能同时指定。
UserAccessKeyId String LTAI4GFTgcR8m8cZQDTH****

RAM用户的访问密钥ID。

说明 必须指定 UserPrincipalNameUserIdUserAccessKeyId三个参数中的一个参数,但不能同时指定。

关于公共请求参数的详情,请参见公共参数

返回数据

名称 类型 示例值 描述
User Object

RAM用户信息。

DisplayName String test

RAM用户的显示名称。

UserPrincipalName String test@example.onaliyun.com

RAM用户的登录名称。

Email String alice@example.com

RAM用户的电子邮箱。

说明 该参数仅适用于中国站。
UpdateDate String 2020-10-13T07:39:22Z

RAM用户的更新时间。

MobilePhone String 86-1868888****

RAM用户的手机号码。

说明 该参数仅适用于中国站。
UserId String 20732900249392****

RAM用户ID。

Comments String This is a cloud computing engineer.

备注。

LastLoginDate String 2020-10-12T09:12:00Z

RAM用户最近一次登录控制台的时间。

CreateDate String 2020-10-12T09:12:00Z

RAM用户的创建时间。

ProvisionType String CloudSSO

同步类型。取值:

  • Manual:在RAM中手动创建的RAM用户。
  • SCIM:通过SCIM协议同步创建的RAM用户。
  • CloudSSO:通过云SSO同步创建的用户。
Tags Array of Tag

标签列表。

Tag
TagKey String operator

标签键。

TagValue String alice

标签值。

RequestId String 4507D1CD-526A-4E2B-A1E2-3AB045D1EE0B

请求ID。

示例

请求示例

https://[Endpoint]/?Action=GetUser
&UserPrincipalName=test@example.onaliyun.com
&UserId=20732900249392****
&UserAccessKeyId=LTAI4GFTgcR8m8cZQDTH****
&<公共请求参数>

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<GetUserResponse>
    <User>
        <DisplayName>test</DisplayName>
        <UserPrincipalName>test@example.onaliyun.com</UserPrincipalName>
        <Email>alice@example.com</Email>
        <UpdateDate>2020-10-13T07:39:22Z</UpdateDate>
        <MobilePhone>86-1868888****</MobilePhone>
        <UserId>20732900249392****</UserId>
        <Comments>This is a cloud computing engineer.</Comments>
        <LastLoginDate>2020-10-12T09:12:00Z</LastLoginDate>
        <CreateDate>2020-10-12T09:12:00Z</CreateDate>
        <ProvisionType>CloudSSO</ProvisionType>
        <Tags>
            <TagKey>operator</TagKey>
            <TagValue>alice</TagValue>
        </Tags>
    </User>
    <RequestId>4507D1CD-526A-4E2B-A1E2-3AB045D1EE0B</RequestId>
</GetUserResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "User" : {
    "DisplayName" : "test",
    "UserPrincipalName" : "test@example.onaliyun.com",
    "Email" : "alice@example.com",
    "UpdateDate" : "2020-10-13T07:39:22Z",
    "MobilePhone" : "86-1868888****",
    "UserId" : "20732900249392****",
    "Comments" : "This is a cloud computing engineer.",
    "LastLoginDate" : "2020-10-12T09:12:00Z",
    "CreateDate" : "2020-10-12T09:12:00Z",
    "ProvisionType" : "CloudSSO",
    "Tags" : [ {
      "TagKey" : "operator",
      "TagValue" : "alice"
    } ]
  },
  "RequestId" : "4507D1CD-526A-4E2B-A1E2-3AB045D1EE0B"
}

错误码

访问错误中心查看更多错误码。