Export API definition to Postman for API testing and monitoring
APPLIES TO: All API Management tiers
To enhance development of your APIs, you can export an API fronted in API Management to Postman. Export an API definition from API Management as a Postman collection so that you can use Postman's tools to design, document, test, monitor, and collaborate on APIs.
Prerequisites
Complete the following quickstart: Create an Azure API Management instance.
Make sure that your instance manages an API that you'd like to export to Postman.
Note
Currently, you can only export HTTP APIs from API Management directly to Postman.
For testing authorization in Postman as outlined later in this article, the API should require a subscription.
A Postman account, which you can use to access Postman for Web.
- Optionally, download and install the Postman desktop app locally.
Go to your API Management instance
In the Azure portal, search for and select API Management services.
On the API Management services page, select your API Management instance.
Export an API to Postman
In the portal, under APIs, select an API.
In the context menu (...), select Export > Postman.
In the Run in dialog, select the Postman location to export to. You can select the option for the desktop app if you've installed it locally.
In Postman, select a Postman workspace to import the API to. The default is My Workspace.
In Postman, select Generate collection from this API to automatically generate a collection from the API definition. If needed, configure advanced import options, or accept default values. Select Import.
The collection and documentation are imported to Postman.
Authorize requests in Postman
If the API you exported requires a subscription, you'll need to configure a valid subscription key from your API Management instance to send requests from Postman.
Use the following steps to configure a subscription key as a secret variable for the collection.
In your Postman workspace, select Environments > Create environment.
Enter a name for the environment such as Azure API Management.
Add a variable with the following values:
- Name - apiKey
- Type - secret
- Initial value - a valid API Management subscription key for the API
Select Save.
Select Collections and the name of the collection that you imported.
Select the Authorization tab.
In the upper right, select the name of the environment you created, such as Azure API Management.
For the key Ocp-Apim-Subscription-Key, enter the variable name
{{apiKey}}
. Select Save.Test your configuration by selecting an operation in your API such as a
GET
operation, and select Send.If correctly configured, the operation returns a
200 OK
status and some output.
Next steps
- Learn more about importing APIs to Postman.
- Learn more about authorizing requests in Postman.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for