Create a custom connector from an OpenAPI definition (2024)

  • Article

Note

This topic is part of a tutorial series on creating and using custom connectors in Azure Logic Apps, Microsoft Power Automate, and Microsoft Power Apps. Make sure you read the custom connector overview to understand the process.

To create a custom connector, you must describe the API you want to connect to so that the connector understands the API's operations and data structures. In this topic, you create a custom connector using an OpenAPI definition that describes the Cognitive Services Text Analytics Sentiment API (our example for this series).

For another way to describe an API, go to Create a custom connector from scratch.

Prerequisites

  • An OpenAPI definition that describes the example API. When creating a custom connector, the OpenAPI definition must be less than 1 MB. The OpenAPI definition needs to be in OpenAPI 2.0 (formerly known as Swagger) format.

    If there are multiple security definitions, the custom connector picks the top security definition. Custom connector creation doesn't support client credentials (for example, application and password) in OAuth security definition.

  • An API key for the Cognitive Services Text Analytics API.

  • One of the following subscriptions:

    • Azure, if you're using Logic Apps
    • Power Automate
    • Power Apps
  • If you're using Logic Apps, first create an Azure Logic Apps custom connector.

Import the OpenAPI definition

You're now ready to work with the OpenAPI definition you downloaded. All the required information is contained in the definition, and you can review and update this information as you go through the custom connector wizard.

Start by importing the OpenAPI definition for Logic Apps, or for Power Automate and Power Apps.

Note

An OpenAPI definition needs to be in OpenAPI 2.0 (formerly known as Swagger) format. OpenAPI definitions that are in OpenAPI 3.0 format are not supported.

Import the OpenAPI definition for Logic Apps

  1. Go to the Azure portal, and open the Logic Apps connector you created earlier in Create an Azure Logic Apps custom connector.

  2. In your connector's menu, select Logic Apps Connector, and then select Edit.

    Create a custom connector from an OpenAPI definition (1)

  3. Under General, select Upload an OpenAPI file, and then go to the OpenAPI definition that you created.

    Create a custom connector from an OpenAPI definition (2)

Import the OpenAPI definition for Power Automate and Power Apps

  1. Sign in to Power Apps or Power Automate.

  2. On the left pane, select Data > Custom connectors.

  3. Select New custom connector, and then select Import an OpenAPI file.

  4. Enter a name for the custom connector, go to the OpenAPI definition that you downloaded or created, and then select Continue.

    Create a custom connector from an OpenAPI definition (3)

    ParameterValue
    Custom connector titleSentimentDemo

Review general details

From this point, we'll show the Power Automate UI, but the steps are largely the same across all three technologies. We'll point out any differences. In this part of the topic, we'll mostly review the UI and show you how the values correspond to sections of the OpenAPI file.

  1. At the top of the wizard, make sure the name is set to SentimentDemo, and then select Create connector.

  2. On the General page, review the information that was imported from the OpenAPI definition, including the API host and the base URL for the API. The connector uses the API host and the base URL to determine how to call the API.

    Create a custom connector from an OpenAPI definition (4)

    Note

    For more information about connecting to on-premises APIs, go to Connect to on-premises APIs using the data gateway.

    The following section of the OpenAPI definition contains information for this page of the UI:

     "info": { "version": "1.0.0", "title": "SentimentDemo", "description": "Uses the Cognitive Services Text Analytics Sentiment API to determine whether text is positive or negative" }, "host": "westus.api.cognitive.microsoft.com", "basePath": "/", "schemes": [ "https" ]

Review authentication type

There are several options available for authentication in custom connectors. The Cognitive Services APIs use API key authentication, so that's what's specified in the OpenAPI definition.

On the Security page, review the authentication information for the API key.

Create a custom connector from an OpenAPI definition (5)

The label is displayed when someone first makes a connection with the custom connector; you can select Edit and change this value. The parameter name and location must match what the API expects, in this case Ocp-Apim-Subscription-Key and Header.

The following section of the OpenAPI definition contains information for this page of the UI:

 "securityDefinitions": { "api_key": { "type": "apiKey", "in": "header", "name": "Ocp-Apim-Subscription-Key" } }

Review the connector definition

The Definition page of the custom connector wizard gives you many options for defining how your connector functions and how it's exposed in logic apps, flows, and apps. We'll explain the UI and cover a few options in this section, but we also encourage you to explore on your own. For information on defining objects from scratch in this UI, go to Create the connector definition.

  1. The following area displays any actions, triggers (for Logic Apps and Power Automate), and references that are defined for the connector. In this case, the DetectSentiment action from the OpenAPI definition is displayed. There are no triggers in this connector, but you can learn about triggers for custom connectors in Use webhooks with Azure Logic Apps and Power Automate.

    Create a custom connector from an OpenAPI definition (6)

  2. The General area displays information about the action or trigger currently selected. You can edit the information here, including the Visibility property for operations and parameters in a logic app or flow:

    • none: displayed normally in the logic app or flow

    • advanced: hidden under an additional menu

    • internal: hidden from the user

    • important: always shown to the user first

      Create a custom connector from an OpenAPI definition (7)

  3. The Request area displays information based on the HTTP request that's included in the OpenAPI definition. In this case, you see that the HTTP verb is POST, and the URL is /text/analytics/v2.0/sentiment (the full URL to the API is <https://westus.api.cognitive.microsoft.com//text/analytics/v2.0/sentiment>). We'll look more closely at the body parameter shortly.

    Create a custom connector from an OpenAPI definition (8)

    The following section of the OpenAPI definition contains information for the General and Request areas of the UI:

    "paths": { "/text/analytics/v2.0/sentiment": { "post": { "summary": "Returns a numeric score representing the sentiment detected", "description": "The API returns a numeric score between 0 and 1. Scores close to 1 indicate positive sentiment, while scores close to 0 indicate negative sentiment.", "operationId": "DetectSentiment"
  4. The Response area displays information based on the HTTP response that's included in the OpenAPI definition. In this case, the only response defined is for 200 (a successful response), but you can define additional responses.

    Create a custom connector from an OpenAPI definition (9)

    The following section of the OpenAPI definition contains some of the information related to the response:

    "score": { "type": "number", "format": "float", "description": "score", "x-ms-summary": "score"},"id": { "type": "string", "description": "id", "x-ms-summary": "id"}

    This section shows the two values that are returned by the connector: id and score. It includes their data types and the field x-ms-summary, which is an OpenAPI extension. For more information on this and other extensions, go to Extend an OpenAPI definition for a custom connector.

  5. The Validation area displays any issues that are detected in the API definition. Make sure to check this area before you save a connector.

    Create a custom connector from an OpenAPI definition (10)

Update the definition

The OpenAPI definition you downloaded is a good basic example, but you might work with definitions that require much updating so that the connector is more friendly when someone uses it in a logic app, flow, or app. We'll show you how to make a change to the definition.

  1. In the Request area, select body, and then select Edit.

    Create a custom connector from an OpenAPI definition (11)

  2. In the Parameter area, you now see the three parameters that the API expects: ID, Language, and Text. Select ID, and then select Edit.

    Create a custom connector from an OpenAPI definition (12)

  3. In the Schema Property area, update the description for the parameter, and then select Back.

    Create a custom connector from an OpenAPI definition (13)

    ParameterValue
    DescriptionA numeric identifier for each document that you submit
  4. In the Parameter area, select Back to take you back to the main definition page.

  5. In the upper-right corner of the wizard, select Update connector.

Download the updated OpenAPI file

You can create a custom connector from an OpenAPI file or from scratch (in Power Automate and Power Apps). Regardless of how you create the connector, you can download the OpenAPI definition that the service uses internally.

  • In Logic Apps, download from the custom connector.

    Create a custom connector from an OpenAPI definition (14)

  • In Power Automate or Power Apps, download from the list of custom connectors.

    Create a custom connector from an OpenAPI definition (15)

Test the connector

Now that you've created the connector, test it to make sure it's working properly. Testing is currently available only in Power Automate and Power Apps.

Important

When using an API key, we recommend against testing the connector immediately after you create it. It can take a few minutes until the connector is ready to connect to the API.

  1. On the Test page, select New connection.

  2. Enter the API key from the Text Analytics API, and then select Create connection.

  3. Return to the Test page, and do one of the following:

    • In Power Automate, you're taken back to the Test page. Select the refresh icon to make sure the connection information is updated.

      Create a custom connector from an OpenAPI definition (16)

    • In Power Apps, you're taken to the list of connections available in the current environment. In the upper-right corner, select the gear icon, and then select Custom connectors. Choose the connector you created, and then go back to the Test page.

      Create a custom connector from an OpenAPI definition (17)

  4. On the Test page, enter a value for the text field (the other fields use the defaults that you set earlier), and then select Test operation.

    Create a custom connector from an OpenAPI definition (18)

  5. The connector calls the API, and you can review the response, which includes the sentiment score.

    Create a custom connector from an OpenAPI definition (19)

Next steps

Now that you've created a custom connector and defined its behaviors, you can use the connector.

  • Use a custom connector from a flow
  • Use a custom connector from an app
  • Use a custom connector from a logic app

You can also share a connector within your organization or get the connector certified so that people outside your organization can use it.

  • Share your connector
  • Certify your connector

Provide feedback

We greatly appreciate feedback on issues with our connector platform, or new feature ideas. To provide feedback, go to Submit issues or get help with connectors and select your feedback type.

Create a custom connector from an OpenAPI definition (2024)

FAQs

How do I Create a custom connector from Open API? ›

Sign in to Power Apps or Power Automate. On the left pane, select Data > Custom connectors. Select New custom connector, and then select Import an OpenAPI file. Enter a name for the custom connector as, copilotforfinancecomms, go to the OpenAPI definition that you downloaded or created, and then select Continue.

How do I Create a custom connector in Azure API? ›

You can also register and call the API from Power Apps or Azure Logic Apps.
  1. Prerequisites. ...
  2. Create and deploy an ASP.NET web app to Azure. ...
  3. Create an OpenAPI (swagger) file that describes your Web API. ...
  4. Set up Microsoft Entra ID authentication. ...
  5. Add authentication to your Azure web app. ...
  6. Add the custom connector to Power Automate.
Feb 17, 2024

How do you Create a custom connector in solution? ›

How to create a custom connector
  1. Navigate to the Power Apps menu, select Solutions, and choose +New solution to create a new solution. Fill out the field and select Create.
  2. Double-click the new solution you have just created. ...
  3. From the Custom connector, you'll be brought to the connector creation page.
Aug 23, 2024

How do I Create an OpenAPI from an existing API? ›

How to generate OpenAPI from existing APIs. Head over to Swagger Inspector, and insert the end point of the resource you want to have documented. You can then navigate to the right panel from the History section of Swagger Inspector, and click "Create API definition" to create the OAS definition.

Can I build a connector without REST API? ›

Creating a Custom Connector: Prerequisites

Access to the API: You'll need access to the API of the service or data source you want to connect to. Basic knowledge of REST APIs: Familiarize yourself with REST APIs, as custom connectors are typically built around them.

How do you deploy a custom connector? ›

To create a custom connector:
  1. Click the Admin tab.
  2. From the Server & Hardware menu, click System Management.
  3. In the System Management pane, click Configuration.
  4. In the System Configuration page, scroll to the bottom and click Manage Connectors.
  5. In the left pane menu, click +JDBC Connector.

What is custom connector? ›

Custom Connector lets users create their own connectors for integrating with external data sources. This documentation provides an overview of the process for creating and managing custom connectors in the Data Productivity Cloud.

How do I create a custom connector in Anypoint studio? ›

Installing or Updating Your Connector in Anypoint Studio
  1. In the package explorer of Anypoint Studio, right-click your project root.
  2. Select Anypoint Connector > Install or Update:
  3. At Check the items you wish to install, click Next.
  4. At Review the items to be installed, click Next.

How do you share custom connectors in solution? ›

You can share them directly, and they're also shared if you share an app or create a team flow that uses the connector.
  1. Go to make.powerapps.com or flow.microsoft.com.
  2. In the navigation pane, select Data > Custom connectors.
  3. Choose the ellipsis button (. . .) for your connector, then choose Invite another user.
May 29, 2024

How do I convert swagger API to OpenAPI? ›

To convert your API:
  1. Open the API in the SwaggerHub editor.
  2. From the dropdown next to the Save button, select Convert to OpenAPI 3.0. — or — ...
  3. In the dialog that appears, click Convert & Update.
  4. SwaggerHub will convert your API and save it as a new version with the -oas3 suffix.

How to generate code from OpenAPI? ›

Generating server code

Select APIs in the sidebar and select an API with an OpenAPI 3.0 definition. In the right sidebar, select the code generation icon. . In the Code Generation pane, select the language and framework for the boilerplate code.

How do I Create a custom API endpoint? ›

  1. Create a custom API record. In your solution, click New > More > Other > custom API from the drop-down. ...
  2. Create any Request Parameters. ...
  3. Create any Response Properties. ...
  4. Observe the result in the service document. ...
  5. Test your custom API. ...
  6. Update the custom API Plugin Type. ...
  7. Other ways to create custom APIs.
Aug 8, 2023

How do I set up API connections? ›

  1. Step 1: Decide What API You Need. What information are you looking for or do you want to change? ...
  2. Step 2: Find the API Docs. ...
  3. Step 3: Find the Endpoint. ...
  4. Step 4: Determine Your Request Type. ...
  5. Step 5: Understand the Parameters. ...
  6. Step 6: Format Your Request. ...
  7. Step 7: Use the Data. ...
  8. Step 8: Final Notes.

How do I call a custom connector in Power Apps? ›

The first thing you do is create an app from blank, then connect to the custom connector that you created in a previous topic.
  1. In make.powerapps.com, choose Start from blank > ...
  2. On the app canvas, choose connect to data.
  3. On the Data panel, choose the connection you created in a previous topic (such as "SentimentDemo").
Apr 19, 2024

How do I import a postman collection into custom connector? ›

Import the Postman collection for Power Automate and Power Apps
  1. Go to make.powerapps.com or flow.microsoft.com.
  2. In the navigation pane, select Data > Custom connectors.
  3. Choose New custom connector, then choose Import a Postman collection.
Mar 29, 2023

Top Articles
Different Types of Asset Classes #The Role of Various Asset Classes – AssetOrbit
Why  Invest in Ethical Fashion
Menards Thermal Fuse
Coverage of the introduction of the Water (Special Measures) Bill
Mawal Gameroom Download
Graveguard Set Bloodborne
The Many Faces of the Craigslist Killer
Xm Tennis Channel
Housing Intranet Unt
World History Kazwire
Bestellung Ahrefs
Craigslist Deming
How do I get into solitude sewers Restoring Order? - Gamers Wiki
Swgoh Turn Meter Reduction Teams
Daylight Matt And Kim Lyrics
White Pages Corpus Christi
Exterior insulation details for a laminated timber gothic arch cabin - GreenBuildingAdvisor
Sulfur - Element information, properties and uses
Aerocareusa Hmebillpay Com
Football - 2024/2025 Women’s Super League: Preview, schedule and how to watch
Violent Night Showtimes Near Century 14 Vallejo
SuperPay.Me Review 2023 | Legitimate and user-friendly
A Person That Creates Movie Basis Figgerits
Magic Seaweed Daytona
Preggophili
Violent Night Showtimes Near Johnstown Movieplex
208000 Yen To Usd
The Monitor Recent Obituaries: All Of The Monitor's Recent Obituaries
Obsidian Guard's Skullsplitter
Att U Verse Outage Map
Human Unitec International Inc (HMNU) Stock Price History Chart & Technical Analysis Graph - TipRanks.com
Craigslist Ludington Michigan
Studio 22 Nashville Review
Rochester Ny Missed Connections
Spectrum Outage in Genoa City, Wisconsin
Cookie Clicker The Advanced Method
My Locker Ausd
Lake Kingdom Moon 31
Cnp Tx Venmo
Homeloanserv Account Login
Sand Castle Parents Guide
Craigslist Antique
About Us
Spreading Unverified Info Crossword Clue
American Bully Puppies for Sale | Lancaster Puppies
Kaamel Hasaun Wikipedia
Mega Millions Lottery - Winning Numbers & Results
Craigslist Chautauqua Ny
Take Me To The Closest Ups
Stephen Dilbeck, The First Hicks Baby: 5 Fast Facts You Need to Know
antelope valley for sale "lancaster ca" - craigslist
Latest Posts
Article information

Author: Kimberely Baumbach CPA

Last Updated:

Views: 5546

Rating: 4 / 5 (61 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Kimberely Baumbach CPA

Birthday: 1996-01-14

Address: 8381 Boyce Course, Imeldachester, ND 74681

Phone: +3571286597580

Job: Product Banking Analyst

Hobby: Cosplaying, Inline skating, Amateur radio, Baton twirling, Mountaineering, Flying, Archery

Introduction: My name is Kimberely Baumbach CPA, I am a gorgeous, bright, charming, encouraging, zealous, lively, good person who loves writing and wants to share my knowledge and understanding with you.