获取RAM用户的某个服务凭证。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ram:GetServiceCredential |
get |
*User
|
|
无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| ServiceCredentialId |
string |
是 |
服务凭证 ID |
SC**************** |
| UserPrincipalName |
string |
否 |
RAM 用户登录名称。 不指定表示获取当前调用身份下的服务凭证。 |
test@example.onaliyun.com |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID |
66815255-7CCE-4759-AC37-9755794C3626 |
| ServiceCredential |
object |
服务凭证信息 |
|
| ServiceCredentialId |
string |
服务凭证 ID |
SC*************** |
| ServiceName |
string |
阿里云服务名称 |
xxx.aliyuncs.com |
| UserPrincipalName |
string |
RAM 用户登录名称 |
test@example.onaliyun.com |
| ServiceCredentialName |
string |
服务凭证名称 |
test |
| CreateTime |
string |
创建时间 |
2026-03-15T09:20:58Z |
| ExpirationTime |
string |
过期时间。 永久有效的服务凭证不返回该字段。 |
2026-04-15T09:20:58Z |
| Status |
string |
服务凭证状态 |
Active |
示例
正常返回示例
JSON格式
{
"RequestId": "66815255-7CCE-4759-AC37-9755794C3626",
"ServiceCredential": {
"ServiceCredentialId": "SC***************",
"ServiceName": "xxx.aliyuncs.com",
"UserPrincipalName": "test@example.onaliyun.com",
"ServiceCredentialName": "test",
"CreateTime": "2026-03-15T09:20:58Z",
"ExpirationTime": "2026-04-15T09:20:58Z",
"Status": "Active"
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。