All Products
Search
Document Center

API Gateway:ExportOAS

Last Updated:Jul 31, 2025

Exports APIs based on OpenAPI Specification (OAS).

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
apigateway:ExportOASget
*ApiGroup
acs:apigateway:{#regionId}:{#accountId}:apigroup/{#GroupId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DataFormatstringNo

The exported format:

  • json
  • yaml
yaml
ApiIdListarrayNo

The APIs that you want to export.

stringNo

The API ID.

8afff6c8c4c6447abb035812e4d66xxx
GroupIdstringNo

The API group ID.

42925e7f5209438186d5560239af5xxx
StageNamestringNo

The environment to which the API is published. Valid values:

  • RELEASE: the production environment
  • PRE: the pre-release environment
  • TEST: the test environment
RELEASE
OasVersionstringNo

The OAS version. Valid values:

  • oas2
  • oas3
oas2
WithXExtensionsbooleanNo

Specifies whether to export API Gateway extensions at the same time.

true
PageNumberintegerNo

The number of pages in which you want to export the APIs.

1

Response parameters

ParameterTypeDescriptionExample
object
Datastring

The Base64-encoded data of the exported Swagger file. You can obtain the file by using Base64 decoding.

UEsDBBQACAAIAABc8FgAAAAAAAAAAAAAAAA...
RequestIdstring

The request ID.

CEF72CEB-54B6-4AE8-B225-F876xxxxxxxx

Examples

Sample success responses

JSONformat

{
  "Data": "UEsDBBQACAAIAABc8FgAAAAAAAAAAAAAAAA...",
  "RequestId": "CEF72CEB-54B6-4AE8-B225-F876xxxxxxxx"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history