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=2021-08-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.

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

Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

api-version
query True

string

Version of the API to be used with the client request.

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.

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/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api?format=swagger-link&export=true&api-version=2021-08-01

Sample response

{
  "id": "/subscriptions/subid/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?sv=2015-07-08&sr=b&sig=mxhLsFuOonu8EXIjyFPV%2FnDra0qTIoip7N7MuU%2BTFsA%3D&se=2019-04-10T22:41:31Z&sp=r"
  }
}

ApiManagementGetApiExportInOpenApi3dot0

Sample request

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/aid9676?export=true&api-version=2021-08-01

Sample response

{
  "id": "/subscriptions/subid/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-signature"
  }
}

Definitions

Name Description
ApiExportResult

API Export result.

ErrorFieldContract

Error Field contract.

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.

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

ErrorFieldContract

Error Field contract.

Name Type Description
code

string

Property level error code.

message

string

Human-readable representation of property-level error.

target

string

Property name.

ErrorResponse

Error Response.

Name Type Description
error.code

string

Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.

error.details

ErrorFieldContract[]

The list of invalid fields send in request, in case of validation error.

error.message

string

Human-readable representation of the error.

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.

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.