查询消费者详情
更新时间:2026-09-21
该接口用于查询指定消费者的基础信息及其已创建的 API Key、AK/SK 认证凭证。
请求结构
Plain Text
1POST /?action=DescribeConsumer HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "consumerId": consumerId
7}
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| consumerId | String | 否 | RequestBody参数 | 消费者 ID |
返回头域
除公共头域,无其它特殊头域。
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| consumerId | String | 消费者 ID |
| consumerName | String | 消费者名称 |
| status | String | 启用状态:Disable-禁用,Enable-启用 |
| createTime | String | 创建时间 |
| description | String | 消费者描述 |
| apiKeys | Map<String, String> | API Key 凭证,key 为鉴权信息 ID,value 为 API Key |
| akSk | Map<String, Object> | AK / SK 凭证,key 为鉴权信息 ID,value 为 AK 与 SK 键值对 |
错误码
| 错误码 | 错误描述 | HTTP状态码 | 中文解释 |
|---|---|---|---|
| HttpMessageNotReadable | Http Message Not Readable: JSON parse error | 400 | 请求体不是合法 JSON,无法解析,请检查 JSON 语法和字段类型 |
| ResourcePermissionDeny | Resource permission deny. | 401 | 无权限访问指定资源,请确认使用正确的账号凭证且资源属于当前账号 |
| ConsumerNotExist | Consumer not exist. | 404 | consumerId 对应的消费者不存在、不属于当前账号或已删除 |
| HttpMediaTypeException | HttpMediaTypeException: Content-Type 'text/plain' is not supported | 415 | 请求的 Content-Type 不受支持,请使用 application/json |
请求示例
Plain Text
1POST /?action=DescribeConsumer HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4
5{
6 "consumerId": "consumer-a1b2c3d4"
7}
返回示例
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Wed, 03 Dec 2014 06:42:19 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6
7{
8 "consumerId": "consumer-a1b2c3d4",
9 "consumerName": "生产消费者",
10 "status": "Enable",
11 "createTime": "2026-09-01T08:00:00Z",
12 "description": "生产环境调用方",
13 "apiKeys": {
14 "authorization_info-m3n4o5p6": "ak-3f8e2d1c9b7a4e6f"
15 },
16 "akSk": {
17 "authorization_info-q7r8s9t0": {
18 "ak": "AKIDm3n4o5p6",
19 "sk": "s9t0q7r8e5f6g7h8"
20 }
21 }
22}
评价此篇文章
