Partager via


Api Export - Get

Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key valid for 5 minutes.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}?format={format}&export=true&api-version=2024-05-01

URI Parameters

Name In Required Type Description
apiId
path True

string

API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.

Regex pattern: ^[^*#&+:<>?]+$

resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

serviceName
path True

string

The name of the API Management service.

Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

subscriptionId
path True

string

uuid

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

The API version to use for this operation.

export
query True

ExportApi

Query parameter required to export the API details.

format
query True

ExportFormat

Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. New formats can be added in the future.

Responses

Name Type Description
200 OK

ApiExportResult

The response contains a stream with a full set of API metadata and includes API entity with an embedded array of operation entities.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

ApiManagementGetApiExportInOpenApi2dot0
ApiManagementGetApiExportInOpenApi3dot0

ApiManagementGetApiExportInOpenApi2dot0

Sample request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api?format=swagger-link&export=true&api-version=2024-05-01

Sample response

{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api",
  "format": "swagger-link-json",
  "value": {
    "link": "https://apimgmtstkjpszxxxxxxx.blob.core.windows.net/api-export/Swagger Petstore Extensive.json?XXXXXXXX"
  }
}

ApiManagementGetApiExportInOpenApi3dot0

Sample request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/aid9676?format=openapi-link&export=true&api-version=2024-05-01

Sample response

{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/aid9676",
  "format": "openapi-link",
  "value": {
    "link": "https: //apimgmtstkjpszxxxxxxx.blob.core.windows.net/api-export/Swagger Petstore.yaml?storage-sas-signatureXXXX"
  }
}

Definitions

Name Description
ApiExportResult

API Export result.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

ExportApi

Query parameter required to export the API details.

ExportFormat

Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. New formats can be added in the future.

ExportResultFormat

Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes.

Value

The object defining the schema of the exported API Detail

ApiExportResult

API Export result.

Name Type Description
format

ExportResultFormat

Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes.

id

string

ResourceId of the API which was exported.

value

Value

The object defining the schema of the exported API Detail

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

ExportApi

Query parameter required to export the API details.

Name Type Description
true

string

ExportFormat

Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. New formats can be added in the future.

Name Type Description
openapi+json-link

string

Export the Api Definition in OpenAPI 3.0 Specification as JSON document to Storage Blob.

openapi-link

string

Export the Api Definition in OpenAPI 3.0 Specification as YAML document to Storage Blob.

swagger-link

string

Export the Api Definition in OpenAPI 2.0 Specification as JSON document to the Storage Blob.

wadl-link

string

Export the Api Definition in WADL Schema to Storage Blob.

wsdl-link

string

Export the Api Definition in WSDL Schema to Storage Blob. This is only supported for APIs of Type soap

ExportResultFormat

Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes.

Name Type Description
openapi-link

string

Export the API Definition in OpenAPI Specification 3.0 to Storage Blob.

swagger-link-json

string

The API Definition is exported in OpenAPI Specification 2.0 format to the Storage Blob.

wadl-link-json

string

Export the API Definition in WADL Schema to Storage Blob.

wsdl-link+xml

string

The API Definition is exported in WSDL Schema to Storage Blob. This is only supported for APIs of Type soap

Value

The object defining the schema of the exported API Detail

Name Type Description
link

string

Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes.