Power Automate hack: HTTP request to REST APIs without premium license
To use the HTTP Connector in Power Automate you need a premium license. I figured out an awesome hack that lets you send an HTTP request to APIs without the premium license. The only limitation is the REST API needs to be without any authentication.
How it’s done
To set up the feature we will use the OneDrive for Business “Upload file from URL”. I find this connector is really useful in general even when used without this hack. You can use it to download any file that is publicly available on the Internet. This includes web pages.
Find a free REST API
To set up the REST API call we need an endpoint. There are lots of free API end points that do not need authentication. If you don’t know of any just search for “free rest api” in your favorite search engine. There is all types of information available.
Example with get country data
For the example in this demo we will find country information using the Rest Countries API with the endpoint set out below. Where {code} needs to be replaced by an ISO country code. To make the flow dynamic we add a user input for the ISO country code.
Upload file from URL
We add to our flow the “Upload file from URL” action from the “OneDrive for Business” connector. As the URL value we put the end point and replace the {code} with our dynamic value. We can add any file name. However, the key is that it must have .json as a file extension.
We save the file as a .json file because this is what we expect to receive back from our REST API. If we were using another API which returns XML we would save the file with the .xml extension.
Get file content
Now the file is saved we are ready to get the contents. This is done with the “OneDrive for Business” connector. Use the dynamic content of the ID from the previous step.
Convert back to JSON
To get the correct data we need to convert the file contents back to JSON. This is done with the built in JSON conversion function. If we leave this step out we get a base64 string.
json(outputs(‘Get_file_content’)?[‘body’])
Parse JSON
To make the JSON data available in your flow as dynamic values run it through the Parse JSON action. Use the “Generate from sample” button to easily create the Schema from the response data.
Finished
That’s it! The flow is finished and you can make REST API calls without a premium license. Below is a GIF of the whole flow running.
You can download the complete flow on this page.