You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/connectors/connectors-native-http-swagger.md
+33-32Lines changed: 33 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,93 +1,94 @@
1
1
---
2
2
title: Connect to REST endpoints from Azure Logic Apps
3
-
description: Monitor REST endpoints in automated tasks, processes, and workflows by using Azure Logic Apps
3
+
description: Connect to REST endpoints from automated workflows in Azure Logic Apps.
4
4
services: logic-apps
5
5
ms.suite: integration
6
-
ms.reviewer: klam, logicappspm
7
-
ms.topic: conceptual
6
+
ms.reviewer: estfan, azla
7
+
ms.topic: how-to
8
8
ms.date: 11/01/2019
9
9
tags: connectors
10
10
---
11
11
12
12
# Call REST endpoints by using Azure Logic Apps
13
13
14
-
With [Azure Logic Apps](../logic-apps/logic-apps-overview.md) and the built-in HTTP + Swagger connector, you can automate workflows that regularly call any REST endpoint through a [Swagger file](https://swagger.io) by building logic apps. The HTTP + Swagger trigger and action work the same as the [HTTP trigger and action](connectors-native-http.md) but provide a better experience in the Logic App Designer by exposing the API structure and outputs described by the Swagger file. To implement a polling trigger, follow the polling pattern that's described in [Create custom APIs to call other APIs, services, and systems from logic apps](../logic-apps/logic-apps-create-api-app.md#polling-triggers).
14
+
With [Azure Logic Apps](../logic-apps/logic-apps-overview.md) and the built-in **HTTP + Swagger** operation, you can create automated integration workflows that regularly call any REST endpoint through a [Swagger file](https://swagger.io). The **HTTP + Swagger** trigger and action work the same as the [HTTP trigger and action](connectors-native-http.md) but provide a better experience in the workflow designer by exposing the API structure and outputs described by the Swagger file. To implement a polling trigger, follow the polling pattern that's described in [Create custom APIs to call other APIs, services, and systems from logic app workflows](../logic-apps/logic-apps-create-api-app.md#polling-triggers).
15
15
16
16
## Prerequisites
17
17
18
-
* An Azure subscription. If you don't have an Azure subscription, [sign up for a free Azure account](https://azure.microsoft.com/free/).
18
+
* An account and Azure subscription. If you don't have an Azure subscription, [sign up for a free Azure account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
19
19
20
-
* The URL for the Swagger (not OpenAPI) file that describes the target REST endpoint
20
+
* The URL for the Swagger (not OpenAPI) file that describes the target REST endpoint that you want to call
21
21
22
-
Typically, the REST endpoint must meet this criteria for the connector to work:
22
+
Typically, the REST endpoint has to meet the following criteria for the trigger or action to work:
23
23
24
24
* The Swagger file must be hosted on an HTTPS URL that's publicly accessible.
25
25
26
-
* The Swagger file must contain an `operationID` for each operation in the definition. If not, the connector only shows the last operation in the Swagger file.
26
+
* The Swagger file must contain an **operationID** property for each operation in the definition. If not, the connector only shows the last operation in the Swagger file.
27
27
28
28
* The Swagger file must have [Cross-Origin Resource Sharing (CORS)](/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services) enabled.
29
29
30
-
To reference a Swagger file that's not hosted or that doesn't meet the security and cross-origin requirements, you can [upload the Swagger file to a blob container in an Azure storage account](#host-swagger), and enable CORS on that storage account so that you can reference the file.
31
-
32
30
The examples in this topic use the [Cognitive Services Face API](../cognitive-services/face/overview.md), which requires a [Cognitive Services account and access key](../cognitive-services/cognitive-services-apis-create-account.md).
33
31
34
-
* Basic knowledge about [how to create logic apps](../logic-apps/quickstart-create-first-logic-app-workflow.md). If you're new to logic apps, review [What is Azure Logic Apps?](../logic-apps/logic-apps-overview.md)
32
+
> [!NOTE]
33
+
> To reference a Swagger file that's unhosted or that doesn't meet the security and cross-origin requirements, you can [upload the Swagger file to a blob container in an Azure storage account](#host-swagger), and enable CORS on that storage account so that you can reference the file.
34
+
35
+
* The logic app workflow from where you want to call the target endpoint. To start with the **HTTP + Swagger** trigger, create a blank logic app workflow. To use the HTTP + Swagger action, start your workflow with any trigger that you want. This example uses the **HTTP + Swagger** trigger as the first step.
35
36
36
-
* The logic app from where you want to call the target endpoint. To start with the HTTP + Swagger trigger, [create a blank logic app](../logic-apps/quickstart-create-first-logic-app-workflow.md). To use the HTTP + Swagger action, start your logic app with any trigger that you want. This example uses the HTTP + Swagger trigger as the first step.
37
+
If you're new to logic app workflows, review [What is Azure Logic Apps?](../logic-apps/logic-apps-overview.md) and [how to create your first logic app workflow](../logic-apps/quickstart-create-first-logic-app-workflow.md).
37
38
38
39
## Add an HTTP + Swagger trigger
39
40
40
-
This built-in trigger sends an HTTP request to a URL for a Swagger file that describes a REST API and returns a response that contains that file's content.
41
+
This built-in trigger sends an HTTP request to a URL for a Swagger file that describes a REST API. The trigger then returns a response that contains that file's content.
41
42
42
-
1. Sign in to the [Azure portal](https://portal.azure.com). Open your blank logic app in Logic App Designer.
43
+
1. Sign in to the [Azure portal](https://portal.azure.com). Open your blank logic app workflow in the designer.
43
44
44
-
1. On the designer, in the search box, enter "swagger" as your filter. From the **Triggers** list, select the **HTTP + Swagger** trigger.
45
+
1. On the designer, in the search box, enter **swagger**. From the **Triggers** list, select the **HTTP + Swagger** trigger.
1. In the **SWAGGER ENDPOINT URL** box, enter the URL for the Swagger file, and select **Next**.
49
+
1. In the **SWAGGER ENDPOINT URL** box, enter the URL for the Swagger file that you want, and select **Next**.
49
50
50
-
This example uses the Swagger URL that is located in the West US region for the [Cognitive Services Face API](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236):
51
+
Make sure to use or create your own endpoint. As an example only, these steps use the following [Cognitive Services Face API](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236) Swagger URL located in the West US region and might not work in your specific trigger:

55
+

55
56
56
57
1. When the designer shows the operations described by the Swagger file, select the operation that you want to use.
57
58
58
-

59
+

59
60
60
61
1. Provide the values for the trigger parameters, which vary based on the selected operation, that you want to include in the endpoint call. Set up the recurrence for how often you want the trigger to call the endpoint.
61
62
62
63
This example renames the trigger to "HTTP + Swagger trigger: Face - Detect" so that the step has a more descriptive name.
63
64
64
-

65
+

65
66
66
67
1. To add other available parameters, open the **Add new parameter** list, and select the parameters that you want.
67
68
68
69
For more information about authentication types available for HTTP + Swagger, see [Add authentication to outbound calls](../logic-apps/logic-apps-securing-a-logic-app.md#add-authentication-outbound).
69
70
70
-
1. Continue building your logic app's workflow with actions that run when the trigger fires.
71
+
1. Continue building your workflow with actions that run when the trigger fires.
71
72
72
-
1. When you're finished, remember to save your logic app. On the designer toolbar, select **Save**.
73
+
1. When you're finished, remember to save your workflow. On the designer toolbar, select **Save**.
73
74
74
75
## Add an HTTP + Swagger action
75
76
76
-
This built-in action makes an HTTP request to the URL for the Swagger file that describes a REST API and returns a response that contains that file's content.
77
+
This built-in action sends an HTTP request to the URL for the Swagger file that describes a REST API. The action then returns a response that contains that file's content.
77
78
78
-
1. Sign in to the [Azure portal](https://portal.azure.com). Open your logic app in Logic App Designer.
79
+
1. Sign in to the [Azure portal](https://portal.azure.com). Open your logic app workflow in designer.
79
80
80
-
1. Under the step where you want to add the HTTP + Swagger action, select **New step**.
81
+
1. Under the step where you want to add the **HTTP + Swagger** action, select **New step**.
81
82
82
83
To add an action between steps, move your pointer over the arrow between steps. Select the plus sign (**+**) that appears, and then select **Add an action**.
83
84
84
-
1. On the designer, in the search box, enter "swagger" as your filter. From the **Actions** list, select the **HTTP + Swagger** action.
85
+
1. On the designer, in the search box, enter **swagger**. From the **Actions** list, select the **HTTP + Swagger** action.
1. In the **SWAGGER ENDPOINT URL** box, enter the URL for the Swagger file, and select **Next**.
89
+
1. In the **SWAGGER ENDPOINT URL** box, enter the URL for the Swagger file that you want, and select **Next**.
89
90
90
-
This example uses the Swagger URL that is located in the West US region for the [Cognitive Services Face API](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236):
91
+
Make sure to use or create your own endpoint. As an example only, these steps use the following [Cognitive Services Face API](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236) Swagger URL located in the West US region and might not work in your specific action:
@@ -107,13 +108,13 @@ This built-in action makes an HTTP request to the URL for the Swagger file that
107
108
108
109
For more information about authentication types available for HTTP + Swagger, see [Add authentication to outbound calls](../logic-apps/logic-apps-securing-a-logic-app.md#add-authentication-outbound).
109
110
110
-
1. When you're finished, remember to save your logic app. On the designer toolbar, select **Save**.
111
+
1. When you're finished, remember to save your logic app workflow. On the designer toolbar, select **Save**.
111
112
112
113
<aname="host-swagger"></a>
113
114
114
115
## Host Swagger in Azure Storage
115
116
116
-
You can reference a Swagger file that's not hosted or that doesn't meet the security and cross-origin requirements by uploading that file to blob container in an Azure storage account and enabling CORS on that storage account. To create, set up, and store Swagger files in Azure Storage, follow these steps:
117
+
You can still reference a Swagger file that's not hosted or that doesn't meet the security and cross-origin requirements. Upload the Swagger file to blob container in an Azure storage account and enable CORS on that storage account. To create, set up, and store Swagger files in Azure Storage, follow these steps:
117
118
118
119
1.[Create an Azure storage account](../storage/common/storage-account-create.md).
119
120
@@ -140,7 +141,7 @@ You can reference a Swagger file that's not hosted or that doesn't meet the secu
140
141
141
142
## Connector reference
142
143
143
-
Here is more information about the outputs from an HTTP + Swagger trigger or action. The HTTP + Swagger call returns this information:
144
+
This section provides more information about the outputs from an **HTTP + Swagger** trigger or action. The **HTTP + Swagger** call returns this information:
144
145
145
146
| Property name | Type | Description |
146
147
|---------------|------|-------------|
@@ -162,4 +163,4 @@ Here is more information about the outputs from an HTTP + Swagger trigger or act
162
163
163
164
## Next steps
164
165
165
-
* Learn about other [Logic Apps connectors](../connectors/apis-list.md)
166
+
* Learn about other [connectors in Azure Logic Apps](../connectors/apis-list.md)
0 commit comments