Description
For querying descriptive documents of a specified API.
- This function is intended for API callers. The specified API must be a public API or an authorized private API that is released to the running stage.
- If you are an API caller, the service information, parameter definition and other details of the API you specify are returned to you.
- If you are an API activator, you can call the API to view the definition of the specified API running in the specified stage. The definition is the one taking effect in the stage and may be different from the definition of the API you modify.
- If you are an API activator, you must confirm that the API is a public API or your app has been authorized because authentication on API callers is required.
Request parameters
Name | Type | Required? | Description |
---|---|---|---|
Action | String | Yes | Operation interface, which is a required parameter; value: DescribeApiDoc. |
GroupId | String | No | ID of the specified group. |
ApiId | String | Yes | ID of the specified API. |
StageName | String | No | Stage name; values:
|
Return parameters
Name | Type | Description |
---|---|---|
RequestId | String | ID of the current request. |
RegionId | String | Region where the API is located. |
GroupId | String | API group ID. |
GroupName | String | API group name. |
StageName | String | Stage name; values:
|
ApiId | String | ID of the API. |
ApiName | String | API name. |
Description | String | API description. |
Visibility | String | Visibility; values: PUBLIC and PRIVATE, indicating a public API and a private API respectively. |
AuthType | String | Security authentication method; values: app and ANONYMOUS, indicating Alibaba Cloud app and anonymous type respectively. |
ResultType | String | Type returned. |
ResultSample | String | Response example. |
FailResultSample | String | Sample of the reply failure returned by the backend service. |
ErrorCodeSamples | ErrorCodeSample | Sample of the error code returned by the backend service. For more information, see ApiAttributesType.md#ErrorCodeSamples. |
RequestConfig | RequestConfig | Returned API front-end definition information, in a format consisting of RequestConfig. |
RequestParameters | RequestParameter | Returned front-end input parameter information items in the API, in an array consisting of RequestParameter. |
Examples
Request example
https://apigateway.cn-qingdao.aliyuncs.com/?Action=DescribeApiDoc
&ApiId=3b81fd160f5645e097cc8855d75a1cf6
&<Public request parameters>
Response example
XML
format
<DescribeApiDocResponse>
<RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BZ014</RequestId>
<RegionId>cn-qingdao</RegionId>
<GroupId>0009db9c828549768a200320714b8930</GroupId>
<GroupName>myGroup2</GroupName>
<StageName>RELEASE</StageName>
<ApiId>3b81fd160f5645e097cc8855d75a1cf6</ApiId>
<ApiName>creatobject</ApiName>
<Description> Object creation</Description>
<Visibility>public</Visibility>
<AuthType>App</AuthType>
<ResultType>application/json</ResultType>
<ResultSample></ResultSample>
<FailResultSample></FailResultSample>
<ErrorCodeSamples>
<ErrorCodeSample>
<Code>400</Code>
<Message>Missing the parameter UserId</Message>
<Description> Request where the parameter UserId is missing</Description>
</ErrorCodeSample>
</ErrorCodeSamples>
<RequestConfig>
<RequestProtocol>HTTP</RequestProtocol>
<RequestHttpMethod>GET</RequestHttpMethod>
<RequestPath>/mypath/creatobject</RequestPath>
<BodyFormat>FORM</BodyFormat>
<PostBodyDescription> Object</PostBodyDescription>
</RequestConfig>
<RequestParameters>
<RequestParameter>
<ApiParameterName>RequestKey1</ApiParameterName>
<Location>QUERY</Location>
<ParameterType>String</ParameterType>
<Required>REQUIRED</Required>
<DefaultValue></DefaultValue>
<DemoValue>demo1</DemoValue>
<MaxValue></MaxValue>
<MinValue></MinValue>
<MaxLength>100</MaxLength>
<MinLength>3</MinLength>
<RegularExpression></RegularExpression>
<JsonScheme></JsonScheme>
<EnumValue></EnumValue>
<DocShow>PUBLIC</DocShow>
<DocOrder>1</DocOrder>
<Description>Desc1</Description>
</RequestParameter>
<RequestParameter>
<ApiParameterName>RequestKey2</ApiParameterName>
<Location>QUERY</Location>
<ParameterType>Number</ParameterType>
<Required>OPTIONAL</Required>
<DefaultValue></DefaultValue>
<DemoValue>12</DemoValue>
<MaxValue>120</MaxValue>
<MinValue>100</MinValue>
<MaxLength></MaxLength>
<MinLength></MinLength>
<RegularExpression></RegularExpression>
<JsonScheme></JsonScheme>
<EnumValue></EnumValue>
<DocShow>PUBLIC</DocShow>
<DocOrder>2</DocOrder>
<Description>Desc2</Description>
</RequestParameter>
</RequestParameters>
</DescribeApiDocResponse>
JSON
format
{
"RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BZ014",
"RegionId": "cn-qingdao",
"GroupId": "0009db9c828549768a200320714b8930",
"GroupName": "myGroup2",
"StageName": "RELEASE",
"ApiId": "3b81fd160f5645e097cc8855d75a1cf6",
"ApiName": "creatobject",
"Description": " Object creation",
"Visibility": "public",
"AuthType": "APP",
"ResultType": "application/json",
"ResultSample": "200",
"FailResultSample": "400",
"ErrorCodeSamples": {
"ErrorCodeSample": [
{
"Code": "400",
"Message": "Missing the parameter UserId",
"Description": " Request where the parameter UserId is missing"
}
]
},
"RequestConfig": {
"RequestProtocol": "HTTP",
"RequestHttpMethod": "GET",
"RequestPath": "/mypath/creatobject",
"BodyFormat": "FORM",
" PostBodyDescription" : " Object"
},
"RequestParameters": {
"RequestParameter": [
{
"ApiParameterName": "RequestKey1",
"Location": "QUERY",
"ParameterType": "String",
"Required": "REQUIRED",
"DemoValue": "demo1",
"MaxLength": "100",
"MinLength": "3",
"DocShow": "PUBLIC",
"DocOrder": "1",
"Description": "Desc1"
},
{
"ApiParameterName": "RequestKey2",
"Location": "QUERY",
"ParameterType": "Number",
"Required": "OPTIONAL",
"DemoValue": "12",
"MaxValue": "120",
"MinValue": "100",
"DocShow": "PUBLIC",
"DocOrder": "2",
"Description": "Desc2"
}
]
}
}