All Products
Search
Document Center

Resource Access Management:GetCallerIdentity

最終更新日:Mar 17, 2023

Queries the identity of the current requester.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
The current API does not require request parameters

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

IdentityTypestring

The type of the identity. Valid values:

  • Account: an Alibaba Cloud account
  • RamUser: a RAM user
  • AssumedRoleUser: a RAM role
RAMUser
AccountIdstring

The ID of the Alibaba Cloud account to which the current requester belongs.

196813200012****
RequestIdstring

The ID of the request.

3C87BF47-3724-5443-ADC1-5AEAD9A03EB1
PrincipalIdstring

The ID of the principal.

28877424437521****
UserIdstring

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.
  • If the requester uses a RAM user to call the operation, the ID of the RAM user is returned.
NoteThis parameter is returned only when the current requester uses an Alibaba Cloud account or a RAM user.
216959339000****
Arnstring

The Alibaba Cloud Resource Name (ARN) of the current requester.

acs:ram::196813200012****:user/admin
RoleIdstring

The ID of the RAM role.

NoteThis parameter is returned only when the current requester uses a RAM role.
33537620082992****

Examples

Sample success responses

JSONformat

{
  "IdentityType": "RAMUser",
  "AccountId": "196813200012****",
  "RequestId": "3C87BF47-3724-5443-ADC1-5AEAD9A03EB1",
  "PrincipalId": "28877424437521****",
  "UserId": "216959339000****",
  "Arn": "acs:ram::196813200012****:user/admin",
  "RoleId": "33537620082992****"
}

Error codes

HTTP status codeError codeError message
500InternalErrorSTS Server Internal Error happened, please send the RequestId to us.
500InternalErrorSTS Server Internal Error happened, please send the RequestId to us.

For a list of error codes, visit the Service error codes.