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
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
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ExportApi;
import com.azure.resourcemanager.apimanagement.models.ExportFormat;
/** Samples for ApiExport Get. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi2dot0.json
*/
/**
* Sample code: ApiManagementGetApiExportInOpenApi2dot0.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementGetApiExportInOpenApi2dot0(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.apiExports()
.getWithResponse(
"rg1", "apimService1", "echo-api", ExportFormat.SWAGGER_LINK, ExportApi.TRUE, Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.apimanagement import ApiManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-apimanagement
# USAGE
python api_management_get_api_export_in_open_api2dot0.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ApiManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.api_export.get(
resource_group_name="rg1",
service_name="apimService1",
api_id="echo-api",
format="swagger-link",
export="true",
)
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi2dot0.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armapimanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi2dot0.json
func ExampleAPIExportClient_Get_apiManagementGetApiExportInOpenApi2Dot0() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAPIExportClient().Get(ctx, "rg1", "apimService1", "echo-api", armapimanagement.ExportFormatSwagger, armapimanagement.ExportAPITrue, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.APIExportResult = armapimanagement.APIExportResult{
// ExportResultFormat: to.Ptr(armapimanagement.ExportResultFormatSwagger),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api"),
// Value: &armapimanagement.APIExportResultValue{
// Link: to.Ptr("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"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ApiManagementClient } = require("@azure/arm-apimanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to 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.
*
* @summary 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.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi2dot0.json
*/
async function apiManagementGetApiExportInOpenApi2Dot0() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const apiId = "echo-api";
const format = "swagger-link";
const exportParam = "true";
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.apiExport.get(
resourceGroupName,
serviceName,
apiId,
format,
exportParam
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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
import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ExportApi;
import com.azure.resourcemanager.apimanagement.models.ExportFormat;
/** Samples for ApiExport Get. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi3dot0.json
*/
/**
* Sample code: ApiManagementGetApiExportInOpenApi3dot0.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementGetApiExportInOpenApi3dot0(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.apiExports()
.getWithResponse("rg1", "apimService1", "aid9676", ExportFormat.OPENAPI_LINK, ExportApi.TRUE, Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.apimanagement import ApiManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-apimanagement
# USAGE
python api_management_get_api_export_in_open_api3dot0.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ApiManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.api_export.get(
resource_group_name="rg1",
service_name="apimService1",
api_id="aid9676",
format="openapi-link",
export="true",
)
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi3dot0.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armapimanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi3dot0.json
func ExampleAPIExportClient_Get_apiManagementGetApiExportInOpenApi3Dot0() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAPIExportClient().Get(ctx, "rg1", "apimService1", "aid9676", armapimanagement.ExportFormatOpenapi, armapimanagement.ExportAPITrue, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.APIExportResult = armapimanagement.APIExportResult{
// ExportResultFormat: to.Ptr(armapimanagement.ExportResultFormatOpenAPI),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/aid9676"),
// Value: &armapimanagement.APIExportResultValue{
// Link: to.Ptr("https: //apimgmtstkjpszxxxxxxx.blob.core.windows.net/api-export/Swagger Petstore.yaml?sv=2015-07-08&sr=b&sig=qqtR1y5iTbz5P7USBduqB5vriIU4gmiGqe0lKVV8j9k%3D&se=2019-04-10T22:40:57Z&sp=r"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ApiManagementClient } = require("@azure/arm-apimanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to 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.
*
* @summary 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.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi3dot0.json
*/
async function apiManagementGetApiExportInOpenApi3Dot0() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const apiId = "aid9676";
const format = "openapi-link";
const exportParam = "true";
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.apiExport.get(
resourceGroupName,
serviceName,
apiId,
format,
exportParam
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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
|
|
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
|
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.
|