Interface description

Obtains detailed user information.

Request parameters

Action 
  • Name: Action
  • Type: String
  • Required: Yes
  • Description: Operation name. It is a required parameter and its value is GetUser.
UserName 
  • Name: UserName
  • Type: String
  • Required: Yes
  • Description: User name, for example, zhangqiang
  • Format:
    ^[a-zA-Z0-9\. @\\-_]+$

Return parameters

User
  • Type: User
  • Description: User information

Required permissions

Action
ram:GetUser
Resource 
acs:ram:*:${AccountId}:user/${UserName}

Error messages

InvalidParameter.UserName.InvalidChars
  • HTTP Status: 400
  • Error Message: The parameter - "UserName" contains invalid chars.
InvalidParameter.UserName.Length
  • HTTP Status: 400
  • Error Message: The parameter - "UserName" beyond the length limit.
Entitynotexist. User
  • HTTP Status: 404
  • Error Message: The user does not exist.

Examples

Request example
https://ram.aliyuncs.com/?Action=GetUser
&UserName=zhangqiang
&<Public request parameters>
Response examples
  • XML format 
    <GetUserResponse>
        <RequestId>2D69A58F-345C-4FDE-88E4-BF5189484043</RequestId>
        <User>
            <UserId>1227489245380721</UserId>
            <UserName>zhangqiang</UserName>
            <Displayname> zhangqiang</displayname>
            <MobilePhone>86-18600008888</MobilePhone>
            <Email>zhangqiang@example.com</Email>
            <Comments>This is a cloud computing engineer.</Comments>
            <CreateDate>2015-01-23T12:33:18Z</CreateDate>
            <UpdateDate>2015-02-11T03:15:21Z</UpdateDate>
            <LastLoginDate>2015-01-23T12:33:18Z</LastLoginDate>
        </User>
        <UserId>1227489245380721</UserId>
    </GetUserResponse>
  • JSON format 
    {
        "RequestId": "2D69A58F-345C-4FDE-88E4-BF5189484043",
        "User": {
            "UserId": "1227489245380721",
            "UserName": "zhangqiang",
            "Displayname": "Zhang Qiang ",
            "Maid phone": "86-18600008888 ",
            "Email": "zhangqiang@example.com",
            "Comments": "This is a cloud computing engineer ",
            "CreateDate": "2015-01-23T12:33:18Z",
            "UpdateDate": "2015-02-11T03:15:21Z",
            "LastLoginDate": "2015-01-23T12:33:18Z"
        }
    }