You need to enable JavaScript to run this app.
文档中心
API 网关

API 网关

复制全文
下载 pdf
消费者管理
CreateConsumerCredential - 创建消费者凭证
复制全文
下载 pdf
CreateConsumerCredential - 创建消费者凭证
创建消费者凭证。​
请求说明​
API 网关已在全球多个地域部署服务,旨在为您提供更稳定、低延迟的访问体验。您可以通过查阅 服务地址 文档,根据业务所在地域,选择最合适的接入点。​
  • 请求方式:POST​
  • 请求地址:https://apig.cn-beijing.volcengineapi.com?Action=CreateConsumerCredential&Version=2021-03-03​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
​
参数​
类型​
是否必选​
示例值​
描述​
Action​
String​
是​
CreateConsumerCredential​
接口名称。当前 API 的名称为 CreateConsumerCredential。​
Version​
String​
是​
2021-03-03​
接口版本。当前 API 的版本为 2021-03-03。​
ConsumerId​
String​
是​
consumer-crbc****​
消费者 ID。您可以通过 ListConsumers 查询消费者 ID。​
CredentialType​
String​
是​
hmac-auth​
凭证类型,取值:​
  • hmac-auth:HMAC 凭证。​
  • key-auth:API Key 凭证。​
HmacAuthCredential​
Object of HmacAuthCredential​
否​
-​
HMAC 凭证。​
说明​
当CredentialType取值为hmac-auth时,需要配置本参数。​
KeyAuthCredential​
Object of KeyAuthCredential​
否​
-​
API Key 凭证。​
说明​
当CredentialType取值为key-auth时,需要配置本参数。​
​
HmacAuthCredential​
​
参数​
类型​
是否必选​
示例值​
描述​
AccessKey​
String​
是​
APIGND****​
Access key。​
SecretKey​
String​
是​
MmMyZ****​
Secret key。​
​
KeyAuthCredential​
​
参数​
类型​
是否必选​
示例值​
描述​
APIKey​
String​
是​
c4cc2338-d85****​
API key。​
​
请求示例​
​
POST https://apig.cn-beijing.volcengineapi.com?Action=CreateConsumerCredential&Version=2021-03-03​
Content-Type: application/json​
{​
"ConsumerId": "consumer-xxxxxxxxxxxxxxxxxxxx",​
"CredentialType": "hmac-auth",​
"HmacAuthCredential": {​
"AccessKey": "APIGND****",​
"SecretKey": "MmMyZ****"​
},​
"KeyAuthCredential": {​
"APIKey": "c4cc2338-d85****"​
}​
}​
​
返回参数​
​
参数​
类型​
示例值​
描述​
Id​
String​
credential-cf8t****​
消费者凭证 ID。​
​
返回示例​
​
Content-Type: application/json​
{​
"ResponseMetadata": {​
"RequestId": "20230604110420****100232280022D31",​
"Action": "CreateConsumerCredential",​
"Version": "2021-03-03",​
"Service": "apig",​
"Region": "cn-beijing"​
},​
"Result": {​
"Id": "credential-cf8t****"​
}​
}​
​
错误码​
本接口无特有的错误码。更多信息请参见 公共错误码。​
最近更新时间:2026.07.29 10:20:05
这个页面对您有帮助吗?
有用
有用
无用
无用