DescribeApi
Queries the definition of a specified API.
Operation description
This operation is intended for users of open APIs.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
apigateway:DescribeApi |
get |
*ApiGroup
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| GroupId |
string |
No |
The ID of the group to which the API belongs. |
123 |
| ApiId |
string |
Yes |
The ID of the API. |
8afff6c8c4c6447abb035812e4d66b65 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| ApiId |
string |
The ID of the API. |
8afff6c8c4c6447abb035812e4d66b65 |
| ResultType |
string |
The format of the response returned by the backend service. Valid values: JSON, TEXT, BINARY, XML, and HTML. |
JSON |
| WebSocketApiType |
string |
The type of the bidirectional communication API. Valid values:
|
COMMON |
| DisableInternet |
boolean |
Specifies whether the API supports only internal network calls. Valid values:
|
false |
| ResultBodyModel |
string |
The response body model of the API. |
{} |
| ResultSample |
string |
The sample response returned by the backend service. |
200 |
| AppCodeAuthType |
string |
The AppCode authentication type when AuthType is set to APP. Valid values:
|
HEADER |
| AllowSignatureMethod |
string |
The signature algorithm used when AuthType is set to APP. If this parameter is not specified, the default value is HmacSHA256. Valid values:
|
HmacSHA256 |
| RegionId |
string |
The region ID of the API. |
cn-qingdao |
| ForceNonceCheck |
boolean |
Specifies whether the X-Ca-Nonce header is required when you call the API. This header is a unique identifier for the request and is typically a UUID. API Gateway validates this parameter to prevent replay attacks. The same value can be used only once within 15 minutes. Valid values:
|
true |
| Visibility |
string |
Specifies whether the API is public. Valid values:
|
PUBLIC |
| FailResultSample |
string |
The sample error response returned by the backend service. |
400 |
| AuthType |
string |
The security authentication type of the API. Valid values:
|
APP |
| ModifiedTime |
string |
The time when the API was last modified. |
2016-07-28T13:13:12Z |
| RequestId |
string |
The request ID. |
D0FF585F-7966-40CF-BC60-75DB070B23D5< |
| Description |
string |
The description of the API. |
Api description |
| GroupName |
string |
The name of the API group to which the API belongs. |
ApiTest |
| GroupId |
string |
The ID of the group to which the API belongs. |
08ae4aa0f95e4321849ee57f4e0b3077 |
| Mock |
string |
Specifies whether to enable mock mode. Valid values:
|
CLOSED |
| MockResult |
string |
The mock response. |
test result |
| CreatedTime |
string |
The time when the API was created. |
2016-07-28T09:50:43Z |
| ApiName |
string |
The name of the API. The name must be unique within the API group. |
ApiName |
| BackendEnable |
boolean |
Specifies whether to enable the backend service. |
true |
| BackendConfig |
object |
The backend configuration. |
|
| BackendId |
string |
The ID of the backend service. |
0038e00c3dca44fcba3a94015d8f5bbf |
| BackendType |
string |
The type of the backend service. |
HTTP |
| BackendName |
string |
The service name of the backend. |
testoss |
| RequestConfig |
object |
The configuration items for API requests sent from the consumer to API Gateway. |
|
| BodyModel |
string |
The body model. |
https://apigateway.aliyun.com/models/3a240a127dcc4afd9ab1bf7e947b4095/9e2df550e85b4121a79ec33e2619eaab |
| RequestPath |
string |
The API path. For example, if the full URL of the API is |
/api/billing/test/[type] |
| RequestHttpMethod |
string |
The HTTP method. Valid values: GET, POST, DELETE, PUT, HEADER, TRACE, PATCH, CONNECT, and OPTIONS. |
POST |
| BodyFormat |
string |
The body format. This parameter takes effect only when RequestMode is set to MAPPING. For POST or PUT requests, this parameter specifies how data is passed to the server. Valid values:
|
STREAM |
| RequestMode |
string |
The request mode. Valid values:
|
MAPPING |
| PostBodyDescription |
string |
The description of the request body. |
fwefwef |
| RequestProtocol |
string |
The protocol types supported by the API. You can specify multiple protocol types and separate them with commas (,), such as HTTP,HTTPS. Valid values: HTTP and HTTPS. |
HTTP |
| EscapePathParam |
boolean |
Specifies whether to escape path parameters. If this parameter is set to true, |
true |
| ServiceConfig |
object |
The configuration items for API requests sent from API Gateway to the backend service. |
|
| AoneAppName |
string |
The name of the Aone application. |
ib-blank |
| MockStatusCode |
integer |
The HTTP status code returned in mock mode. |
200 |
| ContentTypeValue |
string |
The value of the Content-Type header when the backend service is an HTTP service and ContentTypeCatagory is set to DEFAULT or CUSTOM. |
application/x-www-form-urlencoded; charset=UTF-8 |
| ServiceProtocol |
string |
The Terms of Service type of the backend service. Only HTTP and HTTPS are supported. |
HTTP |
| ServicePath |
string |
The path used to call the backend service. For example, if the full URL of the backend service is |
/object/add |
| ContentTypeCatagory |
string |
The policy for the value of the Content-Type header when the backend service is an HTTP service. Valid values:
|
CUSTOM |
| ServiceAddress |
string |
The address used to call the backend service. For example, if the full URL of the backend service is |
http://api.a.com:8080 |
| Mock |
string |
Specifies whether to enable mock mode. Valid values:
|
TRUE |
| ServiceVpcEnable |
string |
Specifies whether to enable the VPC channel. Valid values:
|
TRUE |
| MockResult |
string |
The response returned when mock mode is enabled. |
test result |
| ServiceHttpMethod |
string |
The HTTP method used to call the backend service. Valid values: GET, POST, DELETE, PUT, HEADER, TRACE, PATCH, CONNECT, and OPTIONS. |
POST |
| ServiceTimeout |
integer |
The timeout period for the backend service. Unit: milliseconds. |
1000 |
| MockHeaders |
object |
||
| MockHeader |
array<object> |
The mock headers. |
|
|
object |
|||
| HeaderValue |
string |
The value of the HTTP header. |
86400 |
| HeaderName |
string |
The name of the HTTP header. |
Content-Length |
| VpcConfig |
object |
The configuration items for the VPC channel. |
|
| VpcId |
string |
The VPC ID. |
vpc-2zeafsc3fygk1*** |
| VpcScheme |
string |
The VPC scheme. |
HTTP |
| InstanceId |
string |
The instance ID (ECS or load balancing) in the VPC. |
i-bp1h497hkijewv2*** |
| Port |
integer |
The port number of the instance. |
8080 |
| Name |
string |
The name of the VPC authorization. |
glmall-app-test |
| FunctionComputeConfig |
object |
The backend configuration items when the backend service is Function Compute. |
|
| FcType |
string |
The type of the Function Compute service. |
HttpTrigger |
| RoleArn |
string |
The ARN of the RAM role that authorizes API Gateway to access Function Compute. |
acs:ram::111***:role/aliyunserviceroleforsas |
| Method |
string |
The request method. |
GET |
| FcBaseUrl |
string |
The root path of the Function Compute service. |
https://1227****64334133.ap-southeast-1-int***al.fc.aliyuncs.com/201****-15/proxy/test****ice.LATEST/testHttp/ |
| ContentTypeValue |
string |
The value of the Content-Type header when the backend service is Function Compute and ContentTypeCatagory is set to DEFAULT or CUSTOM. |
application/x-www-form-urlencoded; charset=UTF-8 |
| RegionId |
string |
The region where Function Compute is deployed. |
cn-qingdao |
| OnlyBusinessPath |
boolean |
Specifies whether the backend service receives only the business path. |
false |
| FunctionName |
string |
The function name defined in Function Compute. |
edge_function |
| ContentTypeCatagory |
string |
The policy for the value of the Content-Type header when the backend service is Function Compute. Valid values:
|
DEFAULT |
| Path |
string |
The path of the API request. |
/api/offline/cacheData |
| ServiceName |
string |
The service name defined in Function Compute. |
fcservicename |
| Qualifier |
string |
The function alias. |
2 |
| TriggerName |
string |
The name of the Function Compute trigger. |
test1 |
| FcVersion |
string |
The version used by the Function Compute backend. Valid values: |
2.0 |
| OssConfig |
object |
The configuration information when the backend service is Object Storage Service (OSS). |
|
| Key |
string |
The path of the object or folder stored in OSS. |
/folder/test.json |
| Action |
string |
The OSS operation. Valid values:
|
GetObject |
| OssRegionId |
string |
The region ID of the OSS service. |
cn-hangzhou |
| BucketName |
string |
The OSS bucket name. |
cbg-db |
| EventBridgeConfig |
object |
The EventBridge configuration. |
|
| EventBus |
string |
The event bus. |
testBus |
| EventSource |
string |
The event source. |
baas_driver |
| EventBridgeRegionId |
string |
The region ID of the EventBridge service. |
cn-beijing |
| RoleArn |
string |
The ARN of the RAM role authorized for EventBridge. |
acs:ram::1933122015759***:role/adminoidcaliyun |
| OpenIdConnectConfig |
object |
The OpenID Connect configuration items for third-party account authentication. |
|
| OpenIdApiType |
string |
The OpenID Connect mode. Valid values:
|
IDTOKEN |
| IdTokenParamName |
string |
The name of the parameter that corresponds to the token. |
id_token |
| PublicKeyId |
string |
The public key ID. |
88483727556929326703309904351185815489 |
| PublicKey |
string |
The public key. |
EB1837F8693CCED0BF750B3AD48467BEB569E780A14591CF92 |
| ErrorCodeSamples |
object |
||
| ErrorCodeSample |
array<object> |
The sample error codes returned by the backend service. |
|
|
object |
|||
| Code |
string |
The error code. |
400 |
| Model |
string |
The model. |
[\"*\"] |
| Message |
string |
The error message. |
Missing the parameter UserId |
| Description |
string |
The description. |
The request is missing the UserId parameter |
| SystemParameters |
object |
||
| SystemParameter |
array<object> |
The system parameters sent by the API Gateway to the backend service. |
|
|
object |
|||
| DemoValue |
string |
The example value. |
192.168.1.1 |
| Description |
string |
The parameter description. |
Client IP address |
| ParameterName |
string |
The system parameter name. Valid values: CaClientIp, CaDomain, CaRequestHandleTime, CaAppId, CaRequestId, CaHttpSchema, and CaProxy. |
CaClientIp |
| Location |
string |
The parameter location. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameterName |
string |
The name of the corresponding backend parameter. |
clientIp |
| CustomSystemParameters |
object |
||
| CustomSystemParameter |
array<object> |
The list of custom system parameters. |
|
|
object |
|||
| DemoValue |
string |
The example value. |
192.168.1.1 |
| Description |
string |
The parameter description. |
Client IP address |
| ParameterName |
string |
The system parameter name. Valid values: CaClientIp, CaDomain, CaRequestHandleTime, CaAppId, CaRequestId, CaHttpSchema, and CaProxy. |
CaClientIp |
| Location |
string |
The parameter location. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameterName |
string |
The name of the corresponding backend parameter. |
clientIp |
| ConstantParameters |
object |
||
| ConstantParameter |
array<object> |
The constant parameters sent by the API Gateway to the backend service. |
|
|
object |
|||
| Description |
string |
The parameter description. |
constance |
| Location |
string |
The parameter location. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameterName |
string |
The name of the backend parameter. |
constance |
| ConstantValue |
string |
The parameter value. |
constance |
| RequestParameters |
object |
||
| RequestParameter |
array<object> |
The descriptions of the parameters sent by the consumer to the API Gateway in an API request. |
|
|
object |
|||
| JsonScheme |
string |
The JSON schema for validation when ParameterType is set to String. |
JSON |
| MaxValue |
integer |
The maximum value of the parameter when ParameterType is set to Int, Long, Float, or Double. |
123456 |
| ArrayItemsType |
string |
The type of the array elements. |
String |
| MinValue |
integer |
The minimum value of the parameter when ParameterType is set to Int, Long, Float, or Double. |
123456 |
| DocShow |
string |
The document visibility. Valid values: PUBLIC and PRIVATE. |
PUBLIC |
| MaxLength |
integer |
The maximum length of the parameter when ParameterType is set to String. |
123456 |
| DefaultValue |
string |
The default value. |
20 |
| ApiParameterName |
string |
The parameter name. |
age |
| EnumValue |
string |
The allowed enumeration values when ParameterType is set to Int, Long, Float, Double, or String. Separate multiple values with commas (,). Examples: 1,2,3,4,9 or A,B,C,E,F. |
boy,girl |
| DemoValue |
string |
The example value. |
20 |
| Required |
string |
Specifies whether the parameter is required. Valid values: REQUIRED and OPTIONAL. |
OPTIONAL |
| Description |
string |
The parameter description. |
Age |
| ParameterType |
string |
The parameter type. Valid values: String, Int, Long, Float, Double, and Boolean, which indicate string, integer, long integer, single-precision floating-point, double-precision floating-point, and Boolean types, respectively. |
String |
| RegularExpression |
string |
The regular expression for parameter validation when ParameterType is set to String. |
^[0-9]+$ |
| MinLength |
integer |
The minimum length of the parameter when ParameterType is set to String. |
123456 |
| DocOrder |
integer |
The order of the parameter in the document. |
0 |
| Location |
string |
The parameter location. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameters |
object |
||
| ServiceParameter |
array<object> |
The descriptions of the parameters sent by the API Gateway to the backend service in an API request. |
|
|
object |
|||
| Location |
string |
The parameter location. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ParameterType |
string |
The data type of the backend parameter. Valid values: STRING, NUMBER, and BOOLEAN. |
String |
| ServiceParameterName |
string |
The name of the backend parameter. |
clientIp |
| ServiceParametersMap |
object |
||
| ServiceParameterMap |
array<object> |
The mapping between the parameters sent by the consumer to the API Gateway and the parameters sent by the API Gateway to the backend service. |
|
|
object |
|||
| RequestParameterName |
string |
The name of the corresponding frontend request parameter. This value must exist in RequestParametersObject and match RequestParam.ApiParameterName. |
name |
| ServiceParameterName |
string |
The name of the backend parameter. |
name |
| DeployedInfos |
object |
||
| DeployedInfo |
array<object> |
The publication status of the API. |
|
|
object |
|||
| StageName |
string |
The environment name. Valid values: RELEASE and TEST. |
RELEASE |
| EffectiveVersion |
string |
The effective version. |
20260102030405000 |
| DeployedStatus |
string |
The deployment status. Valid values: DEPLOYED and NONDEPLOYED. |
DEPLOYED |
| TagList |
object |
||
| Tag |
array<object> |
The list of tags. |
|
|
object |
|||
| TagKey |
string |
The tag key. |
APP |
| TagValue |
string |
The tag value. |
value3 |
Examples
Success response
JSON format
{
"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": "test1",
"FcVersion": "2.0"
},
"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": "id_token",
"PublicKeyId": "88483727556929326703309904351185815489",
"PublicKey": "EB1837F8693CCED0BF750B3AD48467BEB569E780A14591CF92"
},
"ErrorCodeSamples": {
"ErrorCodeSample": [
{
"Code": "400",
"Model": "[\\\"*\\\"]",
"Message": "Missing the parameter UserId",
"Description": "Missing parameter UserId"
}
]
},
"SystemParameters": {
"SystemParameter": [
{
"DemoValue": "192.168.1.1",
"Description": "Client 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": "age",
"ParameterType": "String",
"RegularExpression": "^[0-9]+$",
"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": "20260102030405000",
"DeployedStatus": "DEPLOYED"
}
]
},
"TagList": {
"Tag": [
{
"TagKey": "APP",
"TagValue": "value3"
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.