接口描述

为RAM子用户创建AccessKey

请求参数

Action
  • 类型:String
  • 必须:是
  • 描述:操作接口名,系统规定参数,取值:CreateAccessKey
UserName
  • 类型:String
  • 必须:否
  • 描述:指定用户名,子账号调用此接口时,默认为自己创建AccessKey

返回参数

AccessKey

需要的权限

Action
ram:CreateAccessKey
Resource
acs:ram:*:${AccountId}:user/${UserName}

错误信息

InvalidParameter.UserName.InvalidChars
  • HTTP Status:400
  • Error Message:The parameter - "UserName" contains invalid chars.
InvalidParameter.UserName.Length
  • HTTP Status:400
  • Error Message:The parameter - "UserName" beyond the length limit.
LimitExceeded.User.AccessKey
  • HTTP Status:409
  • Error Message:The access key count of the user access keys beyond the current limits.

操作示例

请求示例
https://ram.aliyuncs.com/?Action=CreateAccessKey
&UserName=zhangqiang
&<公共请求参数>
返回示例
  • XML格式
    <CreateAccessKeyResponse>
        <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
        <AccessKey>
            <AccessKeyId>0wNEpMMlzy7szvai</AccessKeyId>
            <AccessKeySecret>PupkTg8jdmau1cXxYacgE736PJj4cA</AccessKeySecret>
            <Status>Active</Status>
            <CreateDate>2015-01-23T12:33:18Z</CreateDate>
        </AccessKey>
    </CreateAccessKeyResponse>
  • JSON格式
    {
        "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
        "AccessKey": {
            "AccessKeyId": "0wNEpMMlzy7szvai",
            "AccessKeySecret": "PupkTg8jdmau1cXxYacgE736PJj4cA",
            "Status": "Active",
            "CreateDate": "2015-01-23T12:33:18Z"
        }
    }