查詢指定API的定義。
介面說明
此介面面向開放 API 的使用者
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
apigateway:DescribeApi |
get |
*ApiGroup
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| GroupId |
string |
否 |
API 所在的分組編號 |
123 |
| ApiId |
string |
是 |
API 的 ID 標識 |
8afff6c8c4c6447abb035812e4d66b65 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| ApiId |
string |
API 的 ID 標識 |
8afff6c8c4c6447abb035812e4d66b65 |
| ResultType |
string |
後端服務返回應答的格式,目前可以設定為:JSON、TEXT、BINARY、XML、HTML。 |
JSON |
| WebSocketApiType |
string |
雙向通訊 API 類型:
|
COMMON |
| DisableInternet |
boolean |
API 是否僅支援內網調用, 取值:
|
false |
| ResultBodyModel |
string |
api 的返回結果 |
{} |
| ResultSample |
string |
後端服務返回應答的樣本 |
200 |
| AppCodeAuthType |
string |
當 AuthType 為 APP 認證時,可選值如下:
|
HEADER |
| AllowSignatureMethod |
string |
當 AuthType 為 APP 認證時,需要傳該值明確簽名演算法。可選值如下,不傳預設是 HmacSHA256:
|
HmacSHA256 |
| RegionId |
string |
API 所處的 Region 的 ID |
cn-qingdao |
| ForceNonceCheck |
boolean |
調用 API 時是否必須攜帶 header : X-Ca-Nonce, 這個是請求的唯一標識,一般使用 UUID 來標識。API Gateway收到這個參數後通過校正這個參數的有效性可以有效防止 API 的重放攻擊,同樣的值,15 分內只能被使用一次。 取值:
|
true |
| Visibility |
string |
API 是否公開,目前可以取值:
|
PUBLIC |
| FailResultSample |
string |
後端服務失敗返回應答的樣本 |
400 |
| AuthType |
string |
API 安全認證類型,目前可以取值:
|
APP |
| ModifiedTime |
string |
API 最後一次修改的時間 |
2016-07-28T13:13:12Z |
| RequestId |
string |
請求 ID |
D0FF585F-7966-40CF-BC60-75DB070B23D5< |
| Description |
string |
API 描述資訊 |
Api description |
| GroupName |
string |
API 所在的分組名稱 |
ApiTest |
| GroupId |
string |
API 所在的分組編號 |
08ae4aa0f95e4321849ee57f4e0b3077 |
| Mock |
string |
是否啟用 MOCK 模式,目前可以取值:
|
CLOSED |
| MockResult |
string |
Mock 返回結果 |
test result |
| CreatedTime |
string |
API 建立的時間 |
2016-07-28T09:50:43Z |
| ApiName |
string |
API 的名稱,組內不允許重複 |
ApiName |
| BackendEnable |
boolean |
是否啟用後端服務 |
true |
| BackendConfig |
object |
後端配置 |
|
| BackendId |
string |
後端服務 ID |
0038e00c3dca44fcba3a94015d8f5bbf |
| BackendType |
string |
後端服務類型 |
HTTP |
| BackendName |
string |
後端服務名稱 |
testoss |
| RequestConfig |
object |
Consumer 向網關發送 API 請求的相關配置項 |
|
| BodyModel |
string |
body 模型 |
https://apigateway.aliyun.com/models/3a240a127dcc4afd9ab1bf7e947b4095/9e2df550e85b4121a79ec33e2619eaab |
| RequestPath |
string |
API path,比如 API 的完全地址為 |
/api/billing/test/[type] |
| RequestHttpMethod |
string |
HTTP Method,取值為:GET、POST、DELETE、PUT、HEADER、TRACE、PATCH、CONNECT、OPTIONS。 |
POST |
| BodyFormat |
string |
當 RequestMode 值為 MAPPING 時有效。 POST/PUT 請求時,表示資料以何種方式傳遞給伺服器,取值為:FORM、STREAM,分別表示表單形式(k-v 對應)、位元組流形式。 |
STREAM |
| RequestMode |
string |
請求的模式,取值為:MAPPING、PASSTHROUGH,分別表示入參映射、入參透傳 |
MAPPING |
| PostBodyDescription |
string |
Body 描述 |
fwefwef |
| RequestProtocol |
string |
API 支援的協議類型,可以多選,多選情況下以英文逗號隔開,如:”HTTP,HTTPS”,取值為:HTTP、HTTPS。 |
HTTP |
| EscapePathParam |
boolean |
是否轉義 Path 參數,如果為 true,則 Path 上的[param]將被視為一般字元。 |
true |
| ServiceConfig |
object |
網關向後端服務發送 API 請求的相關配置項 |
|
| AoneAppName |
string |
aone 應用程式名稱 |
ib-blank |
| MockStatusCode |
integer |
Mock 返回狀態代碼 |
200 |
| ContentTypeValue |
string |
調用後端服務 HTTP 服務,ContentTypeCatagory 的值為 DEFAULT 或者 CUSTOM 時,ContentType 頭的取值。 |
application/x-www-form-urlencoded; charset=UTF-8 |
| ServiceProtocol |
string |
後端服務合約類型,目前只支援 HTTP/HTTPS |
HTTP |
| ServicePath |
string |
調用後端服務 path,比如後端服務完全地址為 |
/object/add |
| ContentTypeCatagory |
string |
調用後端服務 HTTP 服務時,ContentType 頭的取值策略:
|
CUSTOM |
| ServiceAddress |
string |
調用後端服務地址,比如後端服務完全地址為 |
http://api.a.com:8080 |
| Mock |
string |
是否採取 Mock 模式,目前可以取值:
|
TRUE |
| ServiceVpcEnable |
string |
是否啟用 VPC 通道,目前可以取值:
|
TRUE |
| MockResult |
string |
如果啟用 Mock 模式,返回的結果 |
test result |
| ServiceHttpMethod |
string |
調用後端服務 HTTP 協議時的 Method,取值為:GET、POST、DELETE、PUT、HEADER、TRACE、PATCH、CONNECT、OPTIONS。 |
POST |
| ServiceTimeout |
integer |
後端服務逾時時間,單位:毫秒 |
1000 |
| MockHeaders |
object |
||
| MockHeader |
array<object> |
類比 Headers |
|
|
object |
|||
| HeaderValue |
string |
HTTP 頭參數的取值。 |
86400 |
| HeaderName |
string |
HTTP 頭參數的名字。 |
Content-Length |
| VpcConfig |
object |
VPC 通道相關配置項 |
|
| VpcId |
string |
專用網路識別碼 |
vpc-2zeafsc3fygk1*** |
| VpcScheme |
string |
VPC 協議 |
HTTP |
| InstanceId |
string |
專用網路中的執行個體 ID(Ecs/負載平衡) |
i-bp1h497hkijewv2*** |
| Port |
integer |
執行個體對應的連接埠號碼 |
8080 |
| Name |
string |
VPC 授權名稱 |
glmall-app-test |
| FunctionComputeConfig |
object |
後端為Function Compute時的後端配置項 |
|
| FcType |
string |
Function Compute服務類型 |
HttpTrigger |
| RoleArn |
string |
Ram 授權給 API Gateway訪問Function Compute的 arn |
acs:ram::111***:role/aliyunserviceroleforsas |
| Method |
string |
要求方法。 |
GET |
| FcBaseUrl |
string |
Function Compute服務根路徑 |
https://1227****64334133.ap-southeast-1-int***al.fc.aliyuncs.com/201****-15/proxy/test****ice.LATEST/testHttp/ |
| ContentTypeValue |
string |
調用後端服務Function Compute服務,ContentTypeCatagory 的值為 DEFAULT 或者 CUSTOM 時,ContentType 頭的取值。 |
application/x-www-form-urlencoded; charset=UTF-8 |
| RegionId |
string |
Function Compute所在 Region |
cn-qingdao |
| OnlyBusinessPath |
boolean |
後端只接收業務 path |
false |
| FunctionName |
string |
Function Compute定義的 FunctionName |
edge_function |
| ContentTypeCatagory |
string |
調用後端服務Function Compute服務時,ContentType 頭的取值策略:
|
DEFAULT |
| Path |
string |
API 請求路徑 |
/api/offline/cacheData |
| ServiceName |
string |
Function Compute定義的 ServiceName |
fcservicename |
| Qualifier |
string |
函數別名 |
2 |
| TriggerName |
string |
||
| FcVersion |
string |
||
| OssConfig |
object |
後端為 OSS 的資訊 |
|
| Key |
string |
OSS 記憶體儲對象或檔案夾路徑 |
/folder/test.json |
| Action |
string |
OSS 的操作,目前可以取值
|
GetObject |
| OssRegionId |
string |
OSS 服務所在地區 ID。 |
cn-hangzhou |
| BucketName |
string |
OSS 儲存 Bucket。 |
cbg-db |
| EventBridgeConfig |
object |
事件匯流排設定 |
|
| EventBus |
string |
事件匯流排 |
testBus |
| EventSource |
string |
事件來源。 |
baas_driver |
| EventBridgeRegionId |
string |
事件匯流排服務所在地區 ID |
cn-beijing |
| RoleArn |
string |
Ram 授權給 EventBridge 的 arn |
acs:ram::1933122015759***:role/adminoidcaliyun |
| OpenIdConnectConfig |
object |
第三方帳號認證 OpenID Connect 相關配置項 |
|
| OpenIdApiType |
string |
OpenID Connect 模式,目前可以取值:
|
IDTOKEN |
| IdTokenParamName |
string |
Token 對應的參數名稱 |
xxx |
| PublicKeyId |
string |
公開金鑰 ID |
88483727556929326703309904351185815489 |
| PublicKey |
string |
公開金鑰 |
EB1837F8693CCED0BF750B3AD48467BEB569E780A14591CF92 |
| ErrorCodeSamples |
object |
||
| ErrorCodeSample |
array<object> |
後端服務返回的錯誤碼樣本 |
|
|
object |
|||
| Code |
string |
錯誤碼 |
400 |
| Model |
string |
模型 |
[\"*\"] |
| Message |
string |
錯誤資訊 |
Missing the parameter UserId |
| Description |
string |
描述 |
請求缺少參數 UserId |
| SystemParameters |
object |
||
| SystemParameter |
array<object> |
網關發送給後端服務的系統參數 |
|
|
object |
|||
| DemoValue |
string |
樣本 |
192.168.1.1 |
| Description |
string |
參數描述 |
用戶端IP |
| ParameterName |
string |
系統參數名,取值為:CaClientIp、CaDomain、CaRequestHandleTime、CaAppId、CaRequestId、CaHttpSchema、CaProxy。 |
CaClientIp |
| Location |
string |
參數位置,取值為:BODY、HEAD、QUERY、PATH |
HEAD |
| ServiceParameterName |
string |
對應後端參數名稱 |
clientIp |
| CustomSystemParameters |
object |
||
| CustomSystemParameter |
array<object> |
自訂系統參數列表 |
|
|
object |
|||
| DemoValue |
string |
樣本 |
192.168.1.1 |
| Description |
string |
參數描述 |
用戶端IP |
| ParameterName |
string |
系統參數名,取值為:CaClientIp、CaDomain、CaRequestHandleTime、CaAppId、CaRequestId、CaHttpSchema、CaProxy |
CaClientIp |
| Location |
string |
參數位置,取值為:BODY、HEAD、QUERY、PATH |
HEAD |
| ServiceParameterName |
string |
對應後端參數名稱 |
clientIp |
| ConstantParameters |
object |
||
| ConstantParameter |
array<object> |
網關發送給後端服務的常量參數 |
|
|
object |
|||
| Description |
string |
參數描述 |
constance |
| Location |
string |
參數位置,取值為:BODY、HEAD、QUERY、PATH |
HEAD |
| ServiceParameterName |
string |
後端參數名稱 |
constance |
| ConstantValue |
string |
參數值 |
constance |
| RequestParameters |
object |
||
| RequestParameter |
array<object> |
Consumer 向網關發送 API 請求的參數描述 |
|
|
object |
|||
| JsonScheme |
string |
當 ParameterType=String,JSON 驗證(Json Scheme) |
JSON |
| MaxValue |
integer |
當 ParameterType=Int、Long、Float、Double,參數的最大值限定 |
123456 |
| ArrayItemsType |
string |
數組元素的類型 |
String |
| MinValue |
integer |
當 ParameterType=Int、Long、Float、Double,參數的最小值限定 |
123456 |
| DocShow |
string |
文檔可見,取值為:PUBLIC、PRIVATE |
PUBLIC |
| MaxLength |
integer |
當 ParameterType=String,參數的最大長度限定 |
123456 |
| DefaultValue |
string |
預設值 |
20 |
| ApiParameterName |
string |
參數名 |
age |
| EnumValue |
string |
當 ParameterType=Int、Long、Float、Double 或 String,允許輸入的散列值,不同的值用英文的逗號分隔,形如:1,2,3,4,9 或 A,B,C,E,F。 |
boy,girl |
| DemoValue |
string |
樣本 |
20 |
| Required |
string |
是否必填,取值為:REQUIRED、OPTIONAL,分別表示必填、不必填 |
OPTIONAL |
| Description |
string |
參數描述 |
年齡 |
| ParameterType |
string |
參數類型,取值為:String、Int、Long、Float、Double、Boolean,分別表示字元、整型、長整型、單精確度浮點型、雙精確度浮點型、布爾。 |
String |
| RegularExpression |
string |
當 ParameterType=String,參數驗證(Regex) |
xxx |
| MinLength |
integer |
當 ParameterType=String,參數的最小長度限定 |
123456 |
| DocOrder |
integer |
文檔中順序 |
0 |
| Location |
string |
參數位置,取值為:BODY、HEAD、QUERY、PATH |
HEAD |
| ServiceParameters |
object |
||
| ServiceParameter |
array<object> |
網關向後端服務發送 API 請求的參數描述 |
|
|
object |
|||
| Location |
string |
參數位置,取值為:BODY、HEAD、QUERY、PATH |
HEAD |
| ParameterType |
string |
後端參數資料類型,取值為:STRING、NUMBER、BOOLEAN,分別表示字元、數值、布爾。 |
String |
| ServiceParameterName |
string |
後端參數名稱 |
clientIp |
| ServiceParametersMap |
object |
||
| ServiceParameterMap |
array<object> |
Consumer 向網關發送請求的參數和網關向後端服務發送的請求的參數的映射關係 |
|
|
object |
|||
| RequestParameterName |
string |
對應前端入參名稱,這個值必須存在於 RequestParametersObject 中,匹配於 RequestParam.ApiParameterName。 |
name |
| ServiceParameterName |
string |
後端參數名稱 |
name |
| DeployedInfos |
object |
||
| DeployedInfo |
array<object> |
API 發布狀態 |
|
|
object |
|||
| StageName |
string |
環境名稱,取值為:RELEASE、TEST |
RELEASE |
| EffectiveVersion |
string |
有效版本 |
xxx |
| DeployedStatus |
string |
部署狀態,取值為:DEPLOYED、NONDEPLOYED,分別表示已部署、未部署 |
DEPLOYED |
| TagList |
object |
||
| Tag |
array<object> |
標籤列表 |
|
|
object |
|||
| TagKey |
string |
標籤鍵 |
APP |
| TagValue |
string |
標籤值 |
value3 |
樣本
正常返回樣本
JSON格式
{
"ApiId": "8afff6c8c4c6447abb035812e4d66b65",
"ResultType": "JSON",
"WebSocketApiType": "COMMON",
"DisableInternet": false,
"ResultBodyModel": "{}",
"ResultSample": "200",
"AppCodeAuthType": "HEADER",
"AllowSignatureMethod": "HmacSHA256",
"RegionId": "cn-qingdao",
"ForceNonceCheck": true,
"Visibility": "PUBLIC",
"FailResultSample": "400",
"AuthType": "APP",
"ModifiedTime": "2016-07-28T13:13:12Z",
"RequestId": "D0FF585F-7966-40CF-BC60-75DB070B23D5<",
"Description": "Api description",
"GroupName": "ApiTest",
"GroupId": "08ae4aa0f95e4321849ee57f4e0b3077",
"Mock": "CLOSED",
"MockResult": "test result",
"CreatedTime": "2016-07-28T09:50:43Z",
"ApiName": "ApiName",
"BackendEnable": true,
"BackendConfig": {
"BackendId": "0038e00c3dca44fcba3a94015d8f5bbf",
"BackendType": "HTTP",
"BackendName": "testoss"
},
"RequestConfig": {
"BodyModel": "https://apigateway.aliyun.com/models/3a240a127dcc4afd9ab1bf7e947b4095/9e2df550e85b4121a79ec33e2619eaab",
"RequestPath": "/api/billing/test/[type]",
"RequestHttpMethod": "POST",
"BodyFormat": "STREAM",
"RequestMode": "MAPPING",
"PostBodyDescription": "fwefwef",
"RequestProtocol": "HTTP",
"EscapePathParam": true
},
"ServiceConfig": {
"AoneAppName": "ib-blank",
"MockStatusCode": 200,
"ContentTypeValue": "application/x-www-form-urlencoded; charset=UTF-8",
"ServiceProtocol": "HTTP",
"ServicePath": "/object/add",
"ContentTypeCatagory": "CUSTOM",
"ServiceAddress": "http://api.a.com:8080",
"Mock": "TRUE",
"ServiceVpcEnable": "TRUE",
"MockResult": "test result",
"ServiceHttpMethod": "POST",
"ServiceTimeout": 1000,
"MockHeaders": {
"MockHeader": [
{
"HeaderValue": "86400",
"HeaderName": "Content-Length"
}
]
},
"VpcConfig": {
"VpcId": "vpc-2zeafsc3fygk1***",
"VpcScheme": "HTTP",
"InstanceId": "i-bp1h497hkijewv2***",
"Port": 8080,
"Name": "glmall-app-test"
},
"FunctionComputeConfig": {
"FcType": "HttpTrigger",
"RoleArn": "acs:ram::111***:role/aliyunserviceroleforsas",
"Method": "GET",
"FcBaseUrl": "https://1227****64334133.ap-southeast-1-int***al.fc.aliyuncs.com/201****-15/proxy/test****ice.LATEST/testHttp/",
"ContentTypeValue": "application/x-www-form-urlencoded; charset=UTF-8",
"RegionId": "cn-qingdao",
"OnlyBusinessPath": false,
"FunctionName": "edge_function",
"ContentTypeCatagory": "DEFAULT",
"Path": "/api/offline/cacheData",
"ServiceName": "fcservicename",
"Qualifier": "2",
"TriggerName": "",
"FcVersion": ""
},
"OssConfig": {
"Key": "/folder/test.json",
"Action": "GetObject",
"OssRegionId": "cn-hangzhou",
"BucketName": "cbg-db"
},
"EventBridgeConfig": {
"EventBus": "testBus",
"EventSource": "baas_driver",
"EventBridgeRegionId": "cn-beijing",
"RoleArn": "acs:ram::1933122015759***:role/adminoidcaliyun"
}
},
"OpenIdConnectConfig": {
"OpenIdApiType": "IDTOKEN",
"IdTokenParamName": "xxx",
"PublicKeyId": "88483727556929326703309904351185815489",
"PublicKey": "EB1837F8693CCED0BF750B3AD48467BEB569E780A14591CF92"
},
"ErrorCodeSamples": {
"ErrorCodeSample": [
{
"Code": "400",
"Model": "[\\\"*\\\"]",
"Message": "Missing the parameter UserId",
"Description": "請求缺少參數 UserId"
}
]
},
"SystemParameters": {
"SystemParameter": [
{
"DemoValue": "192.168.1.1",
"Description": "用戶端IP",
"ParameterName": "CaClientIp",
"Location": "HEAD",
"ServiceParameterName": "clientIp"
}
]
},
"CustomSystemParameters": {
"CustomSystemParameter": [
{
"DemoValue": "192.168.1.1",
"Description": "用戶端IP",
"ParameterName": "CaClientIp",
"Location": "HEAD",
"ServiceParameterName": "clientIp"
}
]
},
"ConstantParameters": {
"ConstantParameter": [
{
"Description": "constance",
"Location": "HEAD",
"ServiceParameterName": "constance",
"ConstantValue": "constance"
}
]
},
"RequestParameters": {
"RequestParameter": [
{
"JsonScheme": "JSON",
"MaxValue": 123456,
"ArrayItemsType": "String",
"MinValue": 123456,
"DocShow": "PUBLIC",
"MaxLength": 123456,
"DefaultValue": "20",
"ApiParameterName": "age",
"EnumValue": "boy,girl",
"DemoValue": "20",
"Required": "OPTIONAL",
"Description": "年齡",
"ParameterType": "String",
"RegularExpression": "xxx",
"MinLength": 123456,
"DocOrder": 0,
"Location": "HEAD"
}
]
},
"ServiceParameters": {
"ServiceParameter": [
{
"Location": "HEAD",
"ParameterType": "String",
"ServiceParameterName": "clientIp"
}
]
},
"ServiceParametersMap": {
"ServiceParameterMap": [
{
"RequestParameterName": "name",
"ServiceParameterName": "name"
}
]
},
"DeployedInfos": {
"DeployedInfo": [
{
"StageName": "RELEASE",
"EffectiveVersion": "xxx",
"DeployedStatus": "DEPLOYED"
}
]
},
"TagList": {
"Tag": [
{
"TagKey": "APP",
"TagValue": "value3"
}
]
}
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。