You need to enable JavaScript to run this app.
导航
GetCallerIdentity - 获取请求者身份信息
最近更新时间:2025.11.03 14:19:25首次发布时间:2025.10.24 14:39:06
复制全文
我的收藏
有用
有用
无用
无用

获取请求凭证对应的身份信息。

请求说明

此接口的Service为sts,接入地址为:sts.volcengineapi.com。

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

GetCallerIdentity

要执行的操作,取值:GetCallerIdentity。

Version
String

2018-01-01

API的版本,取值:2018-01-01。

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
AccountId
Integer

2000000000

身份所属主账号ID。

Trn
String

trn:iam::2000000000:user/bob

身份的TRN标识。主账号格式为trn:iam::${AccountId}:root;IAM子用户格式为trn:iam::${AccountId}:user/${UserName};角色的格式为trn:sts::${AccountId}:assumed-role/${RoleName}/${RoleSessionName}

IdentityType
String

User

主账号为Account,IAM子用户为User,IAM角色为Role。

IdentityId
String

20000:example-session-name

Account类型下为${AccountID},IAM子用户类型下为${UserId},IAM角色类型下为${RoleId}:${RoleSessionName}

请求示例

GET /?Action=GetCallerIdentity&Version=2018-01-01 HTTP/1.1
Host: sts.volcengineapi.com
X-Date: 20251024T061228Z
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251024/cn-beijing/sts/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f


返回示例

{
  "ResponseMetadata": {
    "RequestId": "20251024141232149184238242E6758E",
    "Action": "GetCallerIdentity",
    "Version": "2018-01-01",
    "Service": "sts",
    "Region": "cn-beijing"
  },
  "Result": {
    "AccountId": 2000000000,
    "Trn": "trn:iam::2000000000:user/bob",
    "IdentityType": "User",
    "IdentityId": "20000:example-session-name"
  }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
401
UnknownCallerIdentity

Unknown caller identity.

身份不存在。