Skip to content

Commit 2993165

Browse files
authored
Merge pull request #299800 from v-albemi/add-api-manually
Freshness Edit: Azure API Management
2 parents 9a5ab30 + 6136b60 commit 2993165

File tree

2 files changed

+57
-53
lines changed

2 files changed

+57
-53
lines changed

articles/api-management/add-api-manually.md

Lines changed: 54 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,121 @@
11
---
2-
title: Add an API manually using the Azure portal | Microsoft Docs
3-
description: This tutorial shows you how to use API Management to add an API manually.
2+
title: Manually Add an API by Using the Azure portal | Microsoft Docs
3+
description: Learn how to use Azure API Management in the Azure portal to manually add an API. Add and test various operations.
44
services: api-management
55
author: dlepow
66

77
ms.service: azure-api-management
88
ms.topic: how-to
9-
ms.date: 06/30/2022
9+
ms.date: 05/16/2025
1010
ms.author: danlep
1111
ms.custom: fasttrack-edit, devdivchpfy22
1212

13+
14+
#customer intent: As an API developer, I want to use API Management to manually add an API.
1315
---
1416

15-
# Add an API manually
17+
# Manually add an API
1618

1719
[!INCLUDE [api-management-availability-all-tiers](../../includes/api-management-availability-all-tiers.md)]
1820

19-
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](mock-api-responses.md).
21+
This article shows how to manually add an API to Azure API Management. When you want to create mock responses from the API, you can create a blank API. For information about creating mock API responses, see [Mock API responses](mock-api-responses.md).
2022

21-
If you want to import an existing API, see [related content](#related-content) section.
23+
If you want to import an existing API, see the [Related content](#related-content) section of this article.
2224

23-
In this article, we create a blank API and specify [httpbin.org](https://httpbin.org) (a public testing service) as a backend API.
25+
In this article, you learn how to create a blank API. You'll specify [httpbin.org](https://httpbin.org) (a public testing service) as a backend API.
2426

2527
## Prerequisites
2628

27-
Complete the following quickstart: [Create an Azure API Management instance](get-started-create-service-instance.md)
29+
- Complete the [Create an Azure API Management instance](get-started-create-service-instance.md) quickstart.
2830

2931
[!INCLUDE [api-management-navigate-to-instance.md](../../includes/api-management-navigate-to-instance.md)]
3032

3133
## Create an API
3234

33-
1. Navigate to your API Management service in the Azure portal and select **APIs** from the menu.
34-
2. From the left menu, select **+ Add API**.
35-
3. Select **HTTP** from the list.
36-
![Blank API](media/add-api-manually/blank-api-1.png)
37-
4. Enter the backend **Web service URL** (for example, `https://httpbin.org`) and other settings for the API. The settings are explained in the [Import and publish your first API](import-and-publish.md#import-and-publish-a-backend-api) tutorial.
38-
5. Select **Create**.
35+
1. Under **APIs** in the left menu, select **APIs**.
36+
1. Select **+ Add API**.
37+
1. Select the **HTTP** tile:
38+
39+
:::image type="content" source="media/add-api-manually/blank-api-1.png" alt-text="Screenshot that shows the HTTP tile in the Azure portal.":::
40+
41+
1. Enter the backend **Web service URL** (for example, `https://httpbin.org`) and other settings for the API. The settings are explained in the [Import and publish your first API](import-and-publish.md#import-and-publish-a-backend-api) tutorial.
42+
1. Select **Create**.
3943

40-
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**.
44+
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's exposed through the backend but not through API Management, you get a 404 error.
4145

4246
>[!NOTE]
43-
> 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.
47+
> By default, when you add an API, even if it's connected to a 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.
4448
4549
## Add and test an operation
4650

47-
This section shows how to add a "/get" operation to map it to the back end "http://httpbin.org/get" operation.
51+
This section shows how to add a `/get` operation to map it to the backend `http://httpbin.org/get` operation.
4852

4953
### Add an operation
5054

5155
1. Select the API you created in the previous step.
52-
2. Select **+ Add Operation**.
53-
3. In the **URL**, select **GET** and enter `/get` in the resource.
54-
4. Enter "*FetchData*" for **Display name**.
55-
5. Select **Save**.
56+
1. Select **+ Add operation**.
57+
1. In **URL**, select **GET** and enter **/get** in the text box.
58+
1. In **Display name**, enter **FetchData**.
59+
1. Select **Save**.
5660

57-
### Test an operation
61+
### Test the operation
5862

59-
Test the operation in the Azure portal. You can also test it in the **Developer portal**.
63+
Test the operation in the Azure portal. (You can also test it in the developer portal.)
6064

6165
1. Select the **Test** tab.
62-
2. Select **FetchData**.
63-
3. Press **Send**.
66+
1. Select **FetchData**.
67+
1. Select **Send**.
6468

65-
The response that the "http://httpbin.org/get" operation generates appears. If you want to transform your operations, see [Transform and protect your API](transform-api.md).
69+
The response that the `http://httpbin.org/get` operation generates appears in the **HTTP response** section. If you want to transform your operations, see [Transform and protect your API](transform-api.md).
6670

6771
## Add and test a parameterized operation
6872

69-
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".
73+
This section shows how to add an operation that takes a parameter. In this example, you map the operation to `http://httpbin.org/status/200`.
7074

71-
### Add the operation
75+
### Add an operation
7276

73-
1. Select the API you created in the previous step.
74-
2. Select **+ Add Operation**.
75-
3. In the **URL**, select **GET** and enter `/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**.
76-
4. Enter "GetStatus" for **Display name**.
77-
5. Select **Save**.
77+
1. Select the API that you created earlier.
78+
1. On the **Design** tab, select **+ Add operation**.
79+
1. In **URL**, select **GET** and enter **/status/{code}** in the text box.
80+
1. In **Display name**, enter **GetStatus**.
81+
1. Select **Save**.
7882

7983
### Test the operation
8084

81-
Test the operation in the Azure portal. You can also test it in the **Developer portal**.
85+
Test the operation in the Azure portal. (You can also test it in the developer portal.)
8286

8387
1. Select the **Test** tab.
84-
2. Select **GetStatus**. By default the code value is set to "*200*". You can change it to test other values. For example, type "*418*".
85-
3. Press **Send**.
88+
1. Select **GetStatus**. In **code**, enter **200**.
89+
1. Select **Send**.
8690

87-
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](transform-api.md).
91+
The response that the `http://httpbin.org/status/200` operation generates appears in the **HTTP response** section. If you want to transform your operations, see [Transform and protect your API](transform-api.md).
8892

8993
## Add and test a wildcard operation
9094

91-
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.
95+
This section shows how to add a wildcard operation. A wildcard operation enables you to 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.
9296

9397
> [!CAUTION]
94-
> Use care when configuring a wildcard operation. This configuration may make an API more vulnerable to certain [API security threats](mitigate-owasp-api-threats.md#improper-inventory-management).
98+
> Be cautious when you configure a wildcard operation. This configuration might make an API more vulnerable to certain [API security threats](mitigate-owasp-api-threats.md#improper-inventory-management).
9599
96-
### Add the operation
100+
### Add an operation
97101

98-
1. Select the API you created in the previous step.
99-
2. Select **+ Add Operation**.
100-
3. In the **URL**, select **GET** and enter `/*` in the resource.
101-
4. Enter "*WildcardGet*" for **Display name**.
102-
5. Select **Save**.
102+
1. Select the API you created earlier.
103+
1. On the **Design** tab, select **+ Add operation**.
104+
1. In **URL**, select **GET** and enter **/*** in the text box.
105+
1. In **Display name**, enter **WildcardGet**.
106+
1. Select **Save**.
103107

104108
### Test the operation
105109

106-
Test the operation in the Azure portal. You can also test it in the **Developer portal**.
110+
Test the operation in the Azure portal. (You can also test it in the developer portal.)
107111

108112
1. Select the **Test** tab.
109-
2. Select **WildcardGet**. Try the GET operations that you tested in previous sections, or try a different supported GET operation.
113+
1. Select **WildcardGet**. Try the GET operations that you tested in previous sections, or try a different supported GET operation.
110114

111-
For example, in **Template parameters**, update the value next to the wildcard (*) name to `headers`. The operation returns the incoming request's HTTP headers.
112-
1. Press **Send**.
115+
For example, in **Template parameters**, change the value next to the wildcard (*) name to **headers**. The operation returns the incoming request's HTTP headers.
116+
1. Select **Send**.
113117

114-
The response that the "http://httpbin.org/headers" operation generates appears. If you want to transform your operations, see [Transform and protect your API](transform-api.md).
118+
The response that the `http://httpbin.org/headers` operation generates appears in the **HTTP response** section. If you want to transform your operations, see [Transform and protect your API](transform-api.md).
115119

116120
>[!NOTE]
117121
> 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](./api-management-faq.yml#how-does-api-management-handle-trailing-slashes-when-calling-backend-services-).

includes/api-management-define-api-topics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ ms.author: danlep
1414
* [Import a SOAP API](../articles/api-management/import-soap-api.md)
1515
* [Import a SOAP API and convert it to REST](../articles/api-management/restify-soap-api.md)
1616
* [Import an App Service API](../articles/api-management/import-app-service-as-api.md)
17-
* [Import a Container App API](../articles/api-management/import-container-app-with-oas.md)
17+
* [Import a container app API](../articles/api-management/import-container-app-with-oas.md)
1818
* [Import a WebSocket API](../articles/api-management/websocket-api.md)
1919
* [Import a GraphQL API](../articles/api-management/graphql-api.md)
2020
* [Import a GraphQL schema and set up field resolvers](../articles/api-management/graphql-schema-resolve-api.md)
21-
* [Import an Azure Function App API](../articles/api-management/import-function-app-as-api.md)
22-
* [Import an Azure Logic App API](../articles/api-management/import-logic-app-as-api.md)
21+
* [Import a function app API](../articles/api-management/import-function-app-as-api.md)
22+
* [Import a logic app API](../articles/api-management/import-logic-app-as-api.md)
2323
* [Import a Service Fabric service](/azure/service-fabric/service-fabric-tutorial-deploy-api-management)
2424
* [Import an Azure AI Foundry API](../articles/api-management/azure-ai-foundry-api.md)
2525
* [Import an Azure OpenAI API](../articles/api-management/azure-openai-api-from-specification.md)

0 commit comments

Comments
 (0)