DescribeApi

Updated at:

Queries the definition of a specified API.

Operation description

  • This operation is intended for users of open APIs.

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

get

*ApiGroup

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

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: Common API.

  • REGISTER: Registration API.

  • UNREGISTER: Unregistration API.

  • NOTIFY: Downstream notification.

COMMON

DisableInternet

boolean

Specifies whether the API supports only internal network calls. Valid values:

  • true: The API supports only internal network calls.

  • false: No restrictions are imposed on API calls.

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:

  • DEFAULT: Default value. If this parameter is not specified, the value is DEFAULT, which follows the group settings.

  • DISABLE: Not allowed.

  • HEADER: AppCode authentication in the header is allowed.

  • HEADER_QUERY: AppCode authentication in the header and query parameters is allowed.

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

  • HmacSHA1,HmacSHA256

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: The X-Ca-Nonce header is required to prevent replay attacks.

  • false: The X-Ca-Nonce header is not checked.

true

Visibility

string

Specifies whether the API is public. Valid values:

  • PUBLIC: Public. If you select this value, the API in the production environment is displayed on the Discover APIs page in the console of all users.

  • PRIVATE: Private. If you select this value, the API is not listed in Alibaba Cloud Marketplace when the API group is listed.

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: Only authorized applications can call the API.

  • ANONYMOUS: Anonymous calls are allowed. Take note of the following items when you allow anonymous calls:
    • Anyone who can obtain the API service information can call the API. API Gateway does not authenticate the callers or support user-level throttling. If you make the API public, configure API-level throttling.

    • We recommend that you do not list anonymous APIs in Alibaba Cloud Marketplace. API Gateway cannot meter calls by user or limit the number of calls. If you want to list the API group in Alibaba Cloud Marketplace, move the API to another group, set the visibility to PRIVATE, or use the APP authentication method.

  • APPOPENID: Supports third-party OpenID Connect authentication. Only authorized applications can call the API. If you set this parameter to APPOPENID, the OpenIdConnectConfig parameter is required.

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:

  • OPEN: Mock mode is enabled.

  • CLOSED: Mock mode is disabled.

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

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

  • FORM: Form data in key-value pairs.

  • STREAM: Byte stream.

STREAM

RequestMode

string

The request mode. Valid values:

  • MAPPING: Parameter mapping.

  • PASSTHROUGH: Parameter passthrough.

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, [param] in the path is treated as a regular character.

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 http://api.a.com:8080/object/add?key1=value1&key2=value2, ServicePath is /object/add.

/object/add

ContentTypeCatagory

string

The policy for the value of the Content-Type header when the backend service is an HTTP service. Valid values:

  • DEFAULT: The default value of API Gateway is used.

  • CUSTOM: A custom value is used.

  • CLIENT: The Content-Type header from the client request is used.

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/object/add?key1=value1&key2=value2, ServiceAddress is http://api.a.com:8080.

http://api.a.com:8080

Mock

string

Specifies whether to enable mock mode. Valid values:

  • TRUE: Mock mode is enabled.

  • FALSE: Mock mode is disabled.

TRUE

ServiceVpcEnable

string

Specifies whether to enable the VPC channel. Valid values:

  • TRUE: The VPC channel is enabled. You must add VPC authorization before you can enable the VPC channel.

  • FALSE: The VPC channel is disabled.

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: The default value of API Gateway is used.

  • CUSTOM: A custom value is used.

  • CLIENT: The Content-Type header from the client request is used.

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 and 3.0.

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

  • PostObject

  • DeleteObject

  • PutObject

  • HeadObject

  • GetObjectMeta

  • AppendObject

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: Obtains the authorization API and issues a token. If this value is specified, the PublicKeyId and PublicKey parameters are required.

  • BUSINESS: The business API for token verification. If this value is specified, the IdTokenParamName parameter is required.

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.