Queries the identity of the current requester.

Request parameters

Parameter Type Required Example Description
Action String Yes GetCallerIdentity The operation that you want to perform. Set the value to GetCallerIdentity.

Response parameters

Parameter Type Example Description
RequestId String 2C9BE469-4A35-44D5-9529-CAA280B11603 The ID of the request.
Arn String acs:ram::196813200012****:user/admin The Alibaba Cloud Resource Name (ARN) of the current requester.
AccountId String 196813200012**** The ID of the Alibaba Cloud account to which the current requester belongs.
UserId String 216959339000****
  • The ID of the current requester. If the requester uses a RAM user to call the operation, the ID of the RAM user is returned.
  • The ID of the current requester. If the requester uses an Alibaba Cloud account to call the operation, the ID of the Alibaba Cloud account is returned.
RoleId String 33537620082992**** The RAM role ID of the current requester. If the requester uses a RAM role to call the operation, the ID of the RAM role is returned.
PrincipalId String 28877424437521**** The ID of the principal.
IdentityType String RAMUser The type of the identity.

Examples

Sample requests

https://sts.aliyuncs.com/?Action=GetCallerIdentity
&<Common request parameters>        

Sample responses

XML format

<GetCallerIdentityResponse>
    <RequestId>2C9BE469-4A35-44D5-9529-CAA280B11603</RequestId>
    <AccountId>196813200012****</AccountId>
    <UserId>216959339000****</UserId>
    <IdentityType>RAMUser</IdentityType>
    <PrincipalId>28877424437521****</PrincipalId>
    <Arn>acs:ram::196813200012****:user/admin</Arn>
</GetCallerIdentityResponse>

JSON format

{
    "RequestId": "2C9BE469-4A35-44D5-9529-CAA280B11603",
    "AccountId": "196813200012****",
    "UserId": "216959339000****",
    "IdentityType": "RAMUser",
    "PrincipalId": "28877424437521****",
    "Arn": "acs:ram::196813200012****:user/admin"
}

Error codes

None.