DescribeApiDoc
Queries the service description document for a specified API.
Operation description
This feature is intended for API callers. The specified API must be published to the runtime environment and have Visibility set to PUBLIC, or be a PRIVATE API that you are authorized to call.
If you are an API caller, this operation returns the service information and parameter definitions of the specified API.
If you are an API provider, calling this operation allows you to view the active definition of the specified API in the specified environment. This definition may differ from the one you are currently modifying, as it reflects the actual definition taking effect in the environment.
If you are an API provider, because this operation authenticates API callers, you must ensure that the API is of the PUBLIC type or your related app is authorized.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
apigateway:DescribeApiDoc |
get |
*ApiGroup
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| GroupId |
string |
No |
The ID of the specified group. |
123 |
| StageName |
string |
No |
The name of the environment. Valid values:
If you do not specify this parameter, the default value is RELEASE. |
RELEASE |
| ApiId |
string |
Yes |
The ID of the specified API. |
3b81fd160f5645e097cc8855d75a1cf6 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| ApiId |
string |
The ID of the API. |
b24be7e59a104e52bffbf432cc9272af |
| ResultType |
string |
The return type. |
JSON |
| DisableInternet |
boolean |
|
true |
| ResultSample |
string |
The sample response. |
{\n \"status\": 0,\n \"data\": {\n \"count\": 1,\n \"list\": [\n \"352\"\n ]\n },\n \"message\": \"success\"\n} |
| RegionId |
string |
The region ID of the API group. |
cn-hangzhou |
| ForceNonceCheck |
boolean |
|
true |
| Visibility |
string |
The visibility of the API. Valid values: PUBLIC and PRIVATE. |
PUBLIC |
| FailResultSample |
string |
The sample response returned when the backend service fails. |
{"errorCode":"fail","errorMessage":"param invalid"} |
| AuthType |
string |
The security authentication method. Valid values:
|
APP |
| RequestId |
string |
The request ID. |
F253FB5F-9AE1-5DDA-99B5-46BE00A3719E |
| GroupId |
string |
The ID of the API group. |
f51d08c5b7c84342905544ebaec26d35 |
| GroupName |
string |
The name of the API group. |
Member Era Trading Service |
| Description |
string |
The description of the API. |
Lynk & Co Digital Mall OMS-UAT |
| DeployedTime |
string |
The deployment time. |
2022-07-13T16:00:33Z |
| StageName |
string |
The name of the environment. Valid values:
|
RELEASE |
| ApiName |
string |
The name of the API. |
Get keyword QR code URL |
| RequestConfig |
object |
The frontend definition of the API in the RequestConfig format. |
|
| 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 |
Valid 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 for input parameters. Valid values:
|
MAPPING |
| PostBodyDescription |
string |
The description of the body. |
fwefwef |
| RequestProtocol |
string |
The protocol types supported by the API. You can select multiple values 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, [param] in the path is treated as a normal character. |
true |
| ErrorCodeSamples |
object |
||
| ErrorCodeSample |
array<object> |
The sample error codes returned by the backend service. |
|
|
object |
The sample error codes returned by the backend service. |
||
| Code |
string |
The error code. |
Error |
| Message |
string |
The error message. |
error message |
| Description |
string |
The description of the error code. |
Unauthorized |
| RequestParameters |
object |
||
| RequestParameter |
array<object> |
The frontend input parameters of the API, in an array of RequestParameter objects. |
|
|
object |
The frontend input parameters of the API, in an array of RequestParameter objects. |
||
| JsonScheme |
string |
JSON scheme |
{} |
| MaxValue |
integer |
The maximum value. |
200 |
| ArrayItemsType |
string |
The type of the array elements. |
String |
| MinValue |
integer |
The minimum value. |
123456 |
| DocShow |
string |
The document visibility. Valid values: PUBLIC and PRIVATE. |
PUBLIC |
| MaxLength |
integer |
The maximum length. |
123456 |
| DefaultValue |
string |
The default value. |
20 |
| ApiParameterName |
string |
The name of the API parameter. |
Length |
| EnumValue |
string |
The allowed enumerated values when ParameterType is 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 sample value. |
20 |
| Required |
string |
Specifies whether the parameter is required. |
OPTIONAL |
| Description |
string |
The description. |
Parameter description |
| ParameterType |
string |
The parameter type. |
String |
| RegularExpression |
string |
The regular expression for parameter validation when ParameterType is String. |
^[a-zA-Z0-9]+$ |
| MinLength |
integer |
The minimum length. |
2 |
| DocOrder |
integer |
The order in the document. |
0 |
| Location |
string |
The location of the parameter. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
Examples
Success response
JSON format
{
"ApiId": "b24be7e59a104e52bffbf432cc9272af",
"ResultType": "JSON",
"DisableInternet": true,
"ResultSample": "{\\n \\\"status\\\": 0,\\n \\\"data\\\": {\\n \\\"count\\\": 1,\\n \\\"list\\\": [\\n \\\"352\\\"\\n ]\\n },\\n \\\"message\\\": \\\"success\\\"\\n}",
"RegionId": "cn-hangzhou",
"ForceNonceCheck": true,
"Visibility": "PUBLIC",
"FailResultSample": "{\"errorCode\":\"fail\",\"errorMessage\":\"param invalid\"}",
"AuthType": "APP",
"RequestId": "F253FB5F-9AE1-5DDA-99B5-46BE00A3719E",
"GroupId": "f51d08c5b7c84342905544ebaec26d35",
"GroupName": "Membership era trading service",
"Description": "Lynk&Co Digital Mall OMS-UAT",
"DeployedTime": "2022-07-13T16:00:33Z",
"StageName": "RELEASE",
"ApiName": "Get keyword QR code URL",
"RequestConfig": {
"RequestPath": "/api/billing/test/[type]",
"RequestHttpMethod": "POST",
"BodyFormat": "STREAM",
"RequestMode": "MAPPING",
"PostBodyDescription": "fwefwef",
"RequestProtocol": "HTTP",
"EscapePathParam": true
},
"ErrorCodeSamples": {
"ErrorCodeSample": [
{
"Code": "Error",
"Message": "error message",
"Description": "Unauthorized"
}
]
},
"RequestParameters": {
"RequestParameter": [
{
"JsonScheme": "{}",
"MaxValue": 200,
"ArrayItemsType": "String",
"MinValue": 123456,
"DocShow": "PUBLIC",
"MaxLength": 123456,
"DefaultValue": "20",
"ApiParameterName": "Length",
"EnumValue": "boy,girl",
"DemoValue": "20",
"Required": "OPTIONAL",
"Description": "Parameter description",
"ParameterType": "String",
"RegularExpression": "^[a-zA-Z0-9]+$",
"MinLength": 2,
"DocOrder": 0,
"Location": "HEAD"
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.