DescribeApiDoc

Updated at:

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

apigateway:DescribeApiDoc

get

*ApiGroup

acs:apigateway:{#regionId}:{#accountId}:apigroup/{#GroupId}

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:

  • RELEASE: production

  • TEST: test

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

  • If DisableInternet is set to true, the API can only be called over the internal network.

  • If DisableInternet is set to false, API calls are not restricted. The default value is false when an API is created.

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

  • If ForceNonceCheck is set to true, the system forcibly checks the X-Ca-Nonce parameter in requests. This parameter is a unique identifier for the request and is typically a UUID. After receiving this parameter, API Gateway verifies its validity. The same value can only be used once within 15 minutes. This effectively prevents replay attacks on the API.

  • If ForceNonceCheck is set to false, the system does not check the parameter. The default value is false when an API is created.

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: Alibaba Cloud app authentication.

  • ANONYMOUS: anonymous authentication.

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: production

  • TEST: test

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 http://api.a.com:8080/object/add?key1=value1&key2=value2, the path refers to the /object/add part.

/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:

  • FORM: form data (key-value pairs).

  • STREAM: byte stream.

STREAM

RequestMode

string

The request mode for input parameters. Valid values:

  • MAPPING: maps input parameters and filters out unknown parameters.

  • PASSTHROUGH: passes through input parameters.

  • MAPPING_PASSTHROUGH: maps input parameters and passes through unknown parameters.

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.