获取消费者。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
apig:GetConsumer |
none |
*Domain
|
无 | 无 |
请求语法
GET /v1/consumers/{consumerId} HTTP/1.1
路径参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| consumerId |
string |
否 |
消费者 ID。 |
cs-ctb92p6m1hkqu85iph8g |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
当前API无需请求参数
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| requestId |
string |
Id of the request |
880C61B3-7B90-5570-A3F7-D6D92C0E2D36 |
| code |
string |
响应码。 |
Ok |
| message |
string |
响应消息。 |
success |
| data |
object |
响应数据。 |
|
| consumerId |
string |
消费者 ID。 |
cs-cvgbtk6m1hkji5sb8dr0 |
| name |
string |
消费者名称。 |
consumer-1 |
| description |
string |
描述。 |
测试专用消费者 |
| jwtIdentityConfig | JwtIdentityConfig |
JWT 身份鉴权配置。 |
|
| apiKeyIdentityConfig | ApiKeyIdentityConfig |
APIKEY 身份鉴权配置。 |
|
| enable |
boolean |
是否启用。 |
true |
| deployStatus |
string |
API 在当前环境的发布状态 |
"" |
| createTimestamp |
integer |
创建时间戳。 |
1719386834548 |
| updateTimestamp |
integer |
更新时间戳。 |
1719386834548 |
| akSkIdentityConfigs |
array |
AKSK 身份鉴权配置。 |
|
| AkSkIdentityConfig |
参数 |
||
| consumerGroups |
array<object> |
||
|
object |
|||
| consumerGroupId |
string |
csg-8c13d2b4f8a1 |
|
| name |
string |
api-consumer-group |
|
| description |
string |
用于线上 API 调用方分组 |
|
| joinTimestamp |
integer |
1715769600000 |
示例
正常返回示例
JSON格式
{
"requestId": "880C61B3-7B90-5570-A3F7-D6D92C0E2D36",
"code": "Ok",
"message": "success",
"data": {
"consumerId": "cs-cvgbtk6m1hkji5sb8dr0",
"name": "consumer-1",
"description": "测试专用消费者",
"jwtIdentityConfig": {
"type": "Jwt",
"secretType": "Symmetry",
"remoteJwks": "{\"uri\":\"https://example.com/.well-known/jwks.json\"}",
"jwks": "xxxx",
"jwtTokenConfig": {
"position": "HEADER",
"key": "Authorization",
"prefix": "test",
"pass": true
},
"jwtPayloadConfig": {
"payloadKeyName": "uid",
"payloadKeyValue": "2222"
},
"claimsToHeadersConfigs": [
{
"claim": "sub",
"header": "X-Consumer-Id",
"override": true
}
]
},
"apiKeyIdentityConfig": {
"type": "Apikey",
"apikeySource": {
"source": "Default",
"value": "xxxx"
},
"credentials": [
{
"generateMode": "System",
"apikey": "xxxxx"
}
]
},
"enable": true,
"deployStatus": "\"\"",
"createTimestamp": 1719386834548,
"updateTimestamp": 1719386834548,
"akSkIdentityConfigs": [
{
"type": "Jwt",
"generateMode": "System",
"ak": "xxxx",
"sk": "xxxx"
}
],
"consumerGroups": [
{
"consumerGroupId": "csg-8c13d2b4f8a1",
"name": "api-consumer-group",
"description": "用于线上 API 调用方分组",
"joinTimestamp": 1715769600000
}
]
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。