Register and use Custom APIs in PowerApps
In PowerApps, we are adding new connectors to various data sources rapidly! However, do you have data sources that are custom – such as APIs deployed in your network or APIs or web apps hosted on cloud services such as Azure Web Apps, AWS, Heroku, Google Cloud etc.? Or, you can’t wait until we actually provide a connector to the data source you want?
Introducing Custom APIs in PowerApps!
Custom APIs are a powerful way to connect to any existing API, hosted anywhere, from PowerApps. You do not need a PowerApps Enterprise subscription to register or use a Custom API.
Custom APIs are RESTful endpoints that you can connect to and use from PowerApps. All you’ll need is a Swagger definition file for your endpoint.
How can I register my Custom API in PowerApps?
You can register a new custom API from powerapps.com. Go to “Connections” under the “Manage” section in the left navigation menu.
And click on “New Connection” on the top right.
Switch to the “Custom” tab and click “New Custom API”.
You’ll now be asked to provide a name and description for your custom API, along with uploading the Swagger definition file and an icon.
The authentication type will be parsed from your Swagger file and you can enter the authentication properties in the next screen. If your API does not use any authentication, you’ll see what’s shown below. For list of all authentication mechanisms currently supported, you can refer to our documentation.
With that, the custom API is created and will appear in your list shown below.
Note that to use this Custom API for creating apps, you’ll need to create a connection to it by clicking on the “+” button and “Add connection”.
And once the connection is added to your list of connections, it’s ready to be used for creating new apps!
How can I use my Custom API to create new apps in PowerApps?
Once you have followed the above steps to register your Custom API and create a connection to it, you can use the new custom API connection for building new apps in PowerApps. Open PowerApps Studio and go to New tab in the left navigation bar and choose Blank app.
From the ribbon, go to “Content” and choose “Data sources”, to open the data sources pane on the right and click on “Add data source”. You can see the CafeAPI connection appear in this list.
Select the CafeAPI and add click “Add Data Source” and the Custom API will be added as a data source to be used in your app.
You can now call methods exposed in the API using the function bar and bind it to say a Gallery control.
The Gallery control will look like this for the method shown above.
That’s it! We’ve made it that easy to connect to your APIs, no matter where they are hosted!
To learn more about how to create, register and use a custom API from PowerApps, you can visit PowerApps help page here. You can also watch the help video for Custom APIs here.
We would love to hear your feedback regarding this new functionality. Please reach out to us via the PowerApps community site.
Thanks!
PowerApps team