Events
Mar 17, 11 PM - Mar 21, 11 PM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
APPLIES TO: All API Management tiers
This article shows steps to add an API manually to the API Management instance. When you want to mock the API, you can create a blank API or define it manually. For details about mocking an API, see Mock API responses.
If you want to import an existing API, see related topics section.
In this article, we create a blank API and specify httpbin.org (a public testing service) as a backend API.
Complete the following quickstart: Create an Azure 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.
https://httpbin.org
) and other settings for the API. The settings are explained in the Import and publish your first API tutorial.At this point, you have no operations in API Management that map to the operations in your backend API. If you call an operation that is exposed through the back end but not through the API Management, you get a 404.
Note
By default, when you add an API, even if it's connected to some backend service, API Management won't expose any operations until you allow them. To allow an operation of your backend service, create an API Management operation that maps to the backend operation.
This section shows how to add a "/get" operation to map it to the back end "http://httpbin.org/get" operation.
/get
in the resource.Test the operation in the Azure portal. You can also test it in the Developer portal.
The response that the "http://httpbin.org/get" operation generates appears. If you want to transform your operations, see Transform and protect your API.
This section shows how to add an operation that takes a parameter. In this case, we map the operation to "http://httpbin.org/status/200".
/status/{code}
in the resource. Optionally, you can provide some information associated with this parameter. For example, enter "Number" for TYPE, "200" (default) for VALUES.Test the operation in the Azure portal. You can also test it in the Developer portal.
Select the Test tab.
Select GetStatus. By default the code value is set to "200". You can change it to test other values. For example, type "418".
Press Send.
The response that the "http://httpbin.org/status/200" operation generates appears. If you want to transform your operations, see Transform and protect your API.
This section shows how to add a wildcard operation. A wildcard operation lets you pass an arbitrary value with an API request. Instead of creating separate GET operations as shown in the previous sections, you could create a wildcard GET operation.
Caution
Use care when configuring a wildcard operation. This configuration may make an API more vulnerable to certain API security threats.
/*
in the resource.Test the operation in the Azure portal. You can also test it in the Developer portal.
Select the Test tab.
Select WildcardGet. Try the GET operations that you tested in previous sections, or try a different supported GET operation.
For example, in Template parameters, update the value next to the wildcard (*) name to headers
. The operation returns the incoming request's HTTP headers.
Press Send.
The response that the "http://httpbin.org/headers" operation generates appears. If you want to transform your operations, see Transform and protect your API.
Note
It can be important to understand how the host for the backend API you're integrating with handles trailing slashes on an operation URL. For more information, see this API Management FAQ.
You can compose an API of APIs exposed by different services, including:
Append a different API to your existing API using the following steps.
Note
When you import another API, the operations are appended to your current API.
Go to your Azure API Management instance in the Azure portal.
Select APIs on the Overview page or from the menu on the left.
Click ... next to the API that you want to append another API to.
Select Import from the drop-down menu.
Select a service from which to import an API.
Events
Mar 17, 11 PM - Mar 21, 11 PM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Integrate OpenAPI-enabled Web APIs with Azure API Management through Visual Studio - Training
Learn how to add an OpenAPI-enabled Web API application to Azure API Management through Visual Studio.