Description
For querying the definition of an API.
- The interface is intended for API activators.
- It is used to query the definition of a specified API.
Request parameters
Name | Type | Required? | Description |
---|---|---|---|
Action | String | Yes | Operation interface, which is a required parameter; value: DescribeApi. |
GroupId | String | No | ID of the group where the API is located. |
ApiId | String | Yes | ID of the API. |
Return parameters
Name | Type | Description |
---|---|---|
RequestId | String | ID of the current API creation request. |
RegionId | String | ID of the region of the API. |
ApiId | String | ID of the API. |
ApiName | String | Name of the API, which is unique in the group. |
GroupId | String | ID of the group where the API is located. |
GroupName | String | Name of the group of the API. |
Visibility | String | Indicates whether the API is public; values:
|
AuthType | String | API security authorization type; values:
|
ResultType | String | Format of the reply returned by the backend service. Currently, allowed formats are JSON, TEXT, BINARY, XML, and HTML. |
ResultSample | String | Sample of the reply returned by the backend service. |
FailResultSample | String | Sample of the reply failure returned by the backend service. |
CreateTime | String | API creation time. |
ModifyTime | String | API last modification time. |
Description | String | API description. |
Mock | String | Indicates whether the Mock mode is used; values: OPEN: The Mock mode is enabled. CLOSE: The Mock mode is disabled. |
MockResult | String | Results returned when the Mock mode is enabled. |
ErrorCodeSamples | ErrorCodeSamples | Sample of the error code returned by the backend service. |
SystemParameters | SystemParameters | System parameters sent by the gateway to a backend service. |
ConstantParameters | ConstantParameter | Constant parameters sent by the gateway to a backend service. |
RequestParametersObject | RequestParameters | Description on parameters of the API request sent by a consumer to the gateway. |
ServiceParametersObject | ServiceParameters | Description on parameters of the API request sent by the gateway to a backend service. |
ParametersMapObject | ServiceParametersMap | The mappings between parameters of a request sent by a consumer to the gateway and parameters of a request sent by the gateway to a backend service. |
DeployedInfos | DeployedInfo | Deployment status of the API. |
RequestConfig | RequestConfig | Configuration items of the API request sent by a consumer to the gateway. |
ServiceConfig | ServiceConfig | Configuration items of the API request sent by the gateway to a backend service. |
Examples
Request example
https://apigateway.cn-qingdao.aliyuncs.com/?Action=DescribeApi
&ApiId=8afff6c8c4c6447abb035812e4d66b65
&<Public request parameters>
Example returned
XML
format
<DescribeApiResponse>
<RequestId>D0FF585F-7966-40CF-BC60-75DB070B23D5</RequestId>
<RegionId>cn-qingdao</RegionId>
<Description>Api description</Description>
<ApiName>ApiName</ApiName>
<CreatedTime>2016-07-28T09:50:43Z</CreatedTime>
<Mock>CLOSED</Mock>
<GroupName>ApiTest</GroupName>
<ModifiedTime>2016-07-28T13:13:12Z</ModifiedTime>
<ServiceParametersObject>
<ServiceParam>
<ServiceParameterName>age</ServiceParameterName>
<Type>Number</Type>
<Location>head</Location>
</ServiceParam>
<ServiceParam>
<ServiceParameterName>sex</ServiceParameterName>
<Type>String</Type>
<Location>query</Location>
</ServiceParam>
<ServiceParam>
<ServiceParameterName>userId</ServiceParameterName>
<Type>Number</Type>
<Location>path</Location>
</ServiceParam>
<ServiceParam>
<ServiceParameterName>clientIp</ServiceParameterName>
<Type>String</Type>
<Location>head</Location>
</ServiceParam>
<ServiceParam>
<ServiceParameterName>constance</ServiceParameterName>
<Type>String</Type>
<Location>head</Location>
</ServiceParam>
</ServiceParametersObject>
<ConstantParameters>
<ConstantParameter>
<ServiceParameterName>constance</ServiceParameterName>
<Description>constance</Description>
<Location>HEAD</Location>
<ConstantValue>constance</ConstantValue>
</ConstantParameter>
</ConstantParameters>
<GroupId>08ae4aa0f95e4321849ee57f4e0b3077</GroupId>
<SystemParameters>
<SystemParameter>
<ServiceParameterName>clientIp</ServiceParameterName>
<Description> Client IP address</Description>
<DemoValue>192.168.1.1</DemoValue>
<Location>HEAD</Location>
<ParameterName>CaClientIp</ParameterName>
</SystemParameter>
</SystemParameters>
<RequestParametersObject>
<RequestParam>
<Required>OPTIONAL</Required>
<MinValue>18</MinValue>
<Description> Age</Description>
<DemoValue>20</DemoValue>
<ParameterType>NUMBER</ParameterType>
<ApiParameterName>age</ApiParameterName>
<DocShow>PUBLIC</DocShow>
<DefaultValue>20</DefaultValue>
<Location>HEAD</Location>
<MaxValue>100</MaxValue>
<DocOrder>0</DocOrder>
</RequestParam>
<RequestParam>
<Required>OPTIONAL</Required>
<Description> Gender</Description>
<DemoValue>boy</DemoValue>
<ParameterType>STRING</ParameterType>
<ApiParameterName>sex</ApiParameterName>
<DocShow>PUBLIC</DocShow>
<DefaultValue>boy</DefaultValue>
<Location>QUERY</Location>
<EnumValue>boy,girl</EnumValue>
<DocOrder>0</DocOrder>
</RequestParam>
<RequestParam>
<Required>REQUIRED</Required>
<MinValue>10000000</MinValue>
<ParameterType>NUMBER</ParameterType>
<ApiParameterName>userId</ApiParameterName>
<DocShow>PUBLIC</DocShow>
<Location>PATH</Location>
<MaxValue>100000000</MaxValue>
<DocOrder>0</DocOrder>
</RequestParam>
</RequestParametersObject>
<DeployedInfos>
<DeployedInfo>
<DeployedStatus>NONDEPLOYED</DeployedStatus>
<StageName>TEST</StageName>
</DeployedInfo>
<DeployedInfo>
<DeployedStatus>NONDEPLOYED</DeployedStatus>
<StageName>RELEASE</StageName>
</DeployedInfo>
</DeployedInfos>
<ServiceConfig>
<ServiceProtocol>HTTP</ServiceProtocol>
<ServiceTimeout>1000</ServiceTimeout>
<ServiceAddress>http://www.customerdomain.com</ServiceAddress>
<ServicePath>/v3/getUserTest/[userId]</ServicePath>
<ServiceHttpMethod>GET</ServiceHttpMethod>
</ServiceConfig>
<RequestId>D0FF585F-7966-40CF-BC60-75DB070B23D5</RequestId>
<RegionId>cn-qingdao</RegionId>
<RequestConfig>
<RequestHttpMethod>GET</RequestHttpMethod>
<RequestProtocol>HTTP</RequestProtocol>
<RequestPath>/v3/getUserTest/[userId]</RequestPath>
</RequestConfig>
<Visibility>PUBLIC</Visibility>
<ParametersMapObject>
<ServiceParameterMap>
<ServiceParameterName>sex</ServiceParameterName>
<RequestParameterName>sex</RequestParameterName>
</ServiceParameterMap>
<ServiceParameterMap>
<ServiceParameterName>age</ServiceParameterName>
<RequestParameterName>age</RequestParameterName>
</ServiceParameterMap>
<ServiceParameterMap>
<ServiceParameterName>userId</ServiceParameterName>
<RequestParameterName>userId</RequestParameterName>
</ServiceParameterMap>
</ParametersMapObject>
<ErrorCodeSamples>
<ErrorCodeSample>
<Code>400</Code>
<Message>Missing the parameter UserId</Message>
<Description> Request where the parameter UserId is missing</Description>
</ErrorCodeSample>
</ErrorCodeSamples>
<ApiId>8afff6c8c4c6447abb035812e4d66b65</ApiId>
<AuthType>APP</AuthType>
<ResultType>HTML</ResultType>
<ResultSample>200</ResultSample>
<FailResultSample>400</FailResultSample>
</DescribeApiResponse>
JSON
format
{
"RequestId":D0FF585F-7966-40CF-BC60-75DB070B23D5,
"RegionId":cn-qingdao,
"Description": "billingTest001",
"ApiName": "billingTest001",
"CreatedTime": "2016-07-01T09:18:20Z",
"Mock": "CLOSED",
"GroupName": "billingTest",
"ModifiedTime": "2016-07-21T03:52:12Z",
"ServiceParametersObject": {
"ServiceParam": [
{
"ServiceParameterName": "headerParam",
"Type": "String",
"Location": "head"
},
{
"ServiceParameterName": "queryparam",
"Type": "String",
"Location": "query"
},
{
"ServiceParameterName": "NumberParam",
"Type": "Number",
"Location": "query"
},
{
"ServiceParameterName": "type",
"Type": "String",
"Location": "path"
},
{
"ServiceParameterName": "clientIp",
"Type": "String",
"Location": "head"
},
{
"ServiceParameterName": "constantParam",
"Type": "String",
"Location": "query"
}
]
},
"ConstantParameters": {
"ConstantParameter": [
{
"ServiceParameterName": "constantParam",
"Description": "constant",
"Location": "QUERY",
"ConstantValue": "constant"
}
]
},
"GroupId": "4a3f3050b9c5469bb685bdd29e571be1",
"SystemParameters": {
"SystemParameter": [
{
"ServiceParameterName": "clientIp",
"Description": " Client IP address",
"DemoValue": "192.168.1.1",
"Location": "HEAD",
"ParameterName": "CaClientIp"
}
]
},
"RequestParametersObject": {
"RequestParam": [
{
"Required": "OPTIONAL",
"Description": "head param",
"DemoValue": "headparm",
"ParameterType": "STRING",
"ApiParameterName": "headerParam",
"DocShow": "PUBLIC",
"DefaultValue": "",
"Location": "HEAD",
"EnumValue": "head",
"DocOrder": 0
},
{
"Required": "REQUIRED",
"ParameterType": "STRING",
"ApiParameterName": "queryparam",
"DocShow": "PUBLIC",
"DefaultValue": "",
"Location": "QUERY",
"DocOrder": 0
},
{
"Required": "OPTIONAL",
"MinValue": 1,
"Description": "number param",
"DemoValue": "10",
"ParameterType": "NUMBER",
"ApiParameterName": "NumberParam",
"DocShow": "PUBLIC",
"DefaultValue": "10",
"Location": "QUERY",
"MaxValue": 100,
"DocOrder": 0
},
{
"Required": "REQUIRED",
"ParameterType": "STRING",
"ApiParameterName": "type",
"DocShow": "PUBLIC",
"Location": "PATH",
"DocOrder": 0
}
]
},
"DeployedInfos": {
"DeployedInfo": [
{
"DeployedStatus": "NONDEPLOYED",
"StageName": "TEST"
},
{
"DeployedStatus": "DEPLOYED",
"StageName": "RELEASE",
"EffectiveVersion": "20160721115223375"
}
]
},
"ServiceConfig": {
"ServiceProtocol": "HTTP",
"ServiceTimeout": 10000,
"ServiceAddress": "http://120.55.69.157:8080",
"ServicePath": "/web/cloudapi/[type]",
"ServiceHttpMethod": "POST"
},
"RequestId": "415F037A-94C2-4100-B17A-F3C514CA1391",
"RegionId": "cn-qingdao",
"RequestConfig": {
"RequestHttpMethod": "POST",
"RequestProtocol": "HTTP",
"PostBodyDescription": "fwefwef",
"BodyFormat": "STREAM",
"RequestPath": "/api/billing/test/[type]"
},
"Visibility": "PUBLIC",
"ParametersMapObject": {
"ServiceParameterMap": [
{
"ServiceParameterName": "headerParam",
"RequestParameterName": "headerParam"
},
{
"ServiceParameterName": "queryparam",
"RequestParameterName": "queryparam"
},
{
"ServiceParameterName": "NumberParam",
"RequestParameterName": "NumberParam"
},
{
"ServiceParameterName": "type",
"RequestParameterName": "type"
}
]
},
"ErrorCodeSamples": {
"ErrorCodeSample": [
{
"Code": "400",
"Message": "Missing the parameter UserId",
"Description": " Request where the parameter UserId is missing"
}
]
},
"ApiId": "e77fd9257b1d436a806fe23c649300a0",
"AuthType": "APP",
"ResultType": "JSON",
"ResultSample": "fwef",
"FailResultSample": "400"
}