GetCallerIdentity

更新时间:
复制 MD 格式

Queries the identity of the current requester.

Try it now

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

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

No parameters required.

Response elements

Parameter

Type

Description

Example

object

The response parameters.

IdentityType

string

The type of the identity. Valid values:

  • Account: an Alibaba Cloud account

  • RAMUser: a RAM user

  • AssumedRoleUser: a RAM role

RAMUser

AccountId

string

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

196813200012****

RequestId

string

The request ID.

3C87BF47-3724-5443-ADC1-5AEAD9A03EB1

PrincipalId

string

The principal ID.

28877424437521****

UserId

string

The user ID.

  • 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.

Note

This parameter is returned only when the current requester uses an Alibaba Cloud account or a RAM user.

216959339000****

Arn

string

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

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

RoleId

string

The ID of the RAM role.

Note

This parameter is returned only when the current requester uses a RAM role.

33537620082992****

Examples

Success response

JSON format

{
  "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 code

Error code

Error message

Description

500

InternalError

STS Server Internal Error happened, please send the RequestId to us.

See for a complete list.

Release notes

See 变更详情 for a complete list.