调用接口

用户扮演角色

请求URL

GET https://sts.163yun.com/v1/assumeRole

请求示例

GET  /v1/assumeRole?accessKey=af9f44d508b4747bbdd0430cadc13658&acceptType=json&signatureVersion=1.0&signatureAlgorithm=HMAC-SHA256&signatureNonce=zm&timestamp=2017-08-22T05%3A46%3A53.844Z&region=cn-east-1&roleNrn=ncs%3Asam%3A%3A179234353551769600%3Arole%2Fuser-sts-cy&duration=2000&secretKey=f086dce0d6dfe248eb42543f97c242e2&signature=694cbbd0dc2e3291a29338d41837e0e0b53137ab5f0f050eea0bfa422bc67449

请求参数

参数类型是否必填描述示例值
accessKeyString公钥af9f44d508b4747bbdd0430cadc13658
secretKeyString私钥f086dce0d6dfe248eb42543f97c242e2
acceptTypeString返回类型json
signatureVersionString签名版本号1.0
signatureAlgorithmString签名算法HMAC-SHA256
signatureNonceString随机值zm
signatureString用户签名694cbbd0dc2e3291a29338d41837e0e0b53137ab5f0f050eea0bfa422bc67449
timestampLongUTC时间2017-07-31T08:14:13Z
regionString可用区cn-east-1
roleNrnString角色全局资源描述符ncs:ram::1234567890123456:role/samplerole
durationInteger过期时间,单位秒。有效范围900~3600,默认3600

响应示例

{
  "requestId": "8062d8e6-abcb-455e-969f-fb5a809c53e5",
  "code": 200,
  "msg": "调用成功",
  "result": {
       "accessKey": "STS.L4aBSCSJVMuKg5U1vFDw",
       "secretKey": "wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pKCNZ9",
       "securityToken": "CAESrAIIARKAAShQquMnLIlbvEcIxO6wCoqJufs8sWwieUxu45hS9AvKNEte8KRUWiJWJ6Y+YHAPgNwi7yfRecMFydL2uPOgBI7LDio0RkbYLmJfIxHM2nGBPdml7kYEOXmJp2aDhbvvwVYIyt/8iES/R6N208wQh0Pk2bu+/9dvalp6wOHF4gkFGhhTVFMuTDRhQlNDU0pWTXVLZzVVMXZGRHciBTQzMjc0KgVhbGljZTCpnJjwySk6BlJzYU1ENUJuCgExGmkKBUFsbG93Eh8KDEFjdGlvbkVxdWFscxIGQWN0aW9uGgcKBW9zczoqEj8KDlJlc291cmNlRXF1YWxzEghSZXNvdXJjZRojCiFhY3M6b3NzOio6NDMyNzQ6c2FtcGxlYm94L2FsaWNlLyo="
       "expireTime": 1483932155000
    }
}

响应参数

参数类型描述示例值
request_idString请求Idbacf68c0-0033-46c6-af86-ccfa428fee14
codeInteger错误码200
msgString响应消息success
resultObject返回结果-
accessKeyString公钥STS.L4aBSCSJVMuKg5U1vFDw
secretKeyString私钥wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pKCNZ9
securityTokenStringSTS TokenCAESrAIIA...94L2FsaWNlLyo=
expireTimeLong过期时间1483932155000

错误码

codemessage
1001参数错误
1003签名不合法
1004产品未激活
2007角色不存在
2013没有对应权限
2015禁止主账号访问