Calling REST API using Power automate😲🤯

Ravi Kumar
4 min readSep 11, 2022

--

Hello folks, here we are going to talk about how you can integrate a REST API in power automate to get the response and do the required action.

Table of Content:

  • What is REST API?
  • What are the Free websites to test REST API?
  • Power automate flow to call a REST API

What is REST API?

An application programming interface (API or web API) that complies with the requirements of the REST architectural style and permits interaction with RESTful web services is referred to as a REST API (also known as a RESTful API). Computer scientist Roy Fielding developed REST or representational state transfer.

Architecture

A collection of specifications and protocols known as an API are used to create and integrate application software. It’s also referred to as a contract between a supplier of information and a user of that information, outlining the content that the consumer (the call) and the producer (the producer) are obligated to deliver (the response). For instance, the API design for a weather service may need the user to provide their zip code and the producer to respond with two parts, the first of which would be the high temperature and the second, the low.

API Requests
  • When the server receives an HTTP request from the client, JSON or XML is delivered as the response.

Type of Requests :

GET : Read from database
PUT : Update/Replace row in database
PATCH : Update/Modify row in database
POST : Create a new record in the database
DELETE : Delete from the database

What are the Free websites to test REST API?

The following list of the website provides you with free API endpoints to test/practice REST APIs

1) https://reqres.in/
2)
http://dummy.restapiexample.com/
3)
https://jsonplaceholder.typicode.com/
4)
https://gorest.co.in/
5)
https://restful-booker.herokuapp.com/
6)
https://httpbin.org/#/
7)
https://petstore.swagger.io/
8)
https://fakerestapi.azurewebsites.net/index.html
9)
https://documenter.getpostman.com/view/4016432/RWToRJCq#intro
10)
https://developers.google.com/maps/documentation

Power automate flow to call our REST API

We will be using “http://dummy.restapiexample.com/API for our power automate flow.

Let’s first start with getting a GET request public END point.

To check if the second URL is functioning or not and to see what answer we are receiving, copy it and put it into a new tab of your browser.

{"id":1,"employee_name":"Tiger Nixon","employee_salary":320800,"employee_age":61,"profile_image":""}

Here we got a JSON response with ID, Employee name, Employee Salary, Employee age, and profile image.

Everything seems to be working fine, let’s start with the flow then:

  • Click on “Create ”and choose “Instant cloud flow”
  • Give a name to your flow, “choose Manually trigger a flow” and press “Create”
  • Choose an operation, search for HTTP and select the first one
  • Choose the GET method and pass the API endpoint in the URL section
  • Choose another operation “Parse JSON”
  • Pass the API body response to the content of parse JSON and click on “Generate from sample
  • Copy the response output and paste it into the section and press “Done”
{"status":"success","data":{"id":1,"employee_name":"Tiger Nixon","employee_salary":320800,"employee_age":61,"profile_image":""},"message":"Successfully! Record has been fetched."}
  • Power automate will automatically create the schema for the output
{"type": "object","properties": {"status": {"type": "string"},"data": {"type": "object","properties": {"id": {"type": "integer"},"employee_name": {"type": "string"},"employee_salary": {"type": "integer"},"employee_age": {"type": "integer"},"profile_image": {"type": "string"}}},"message": {"type": "string"}}}
  • The last step would be to send out a mail with all the outputs
  • Save the flow and click on “Test”
  • The flow is successful, let’s check our mail for the response
  • Yes we received the mail

Want to read more: https://medium.com/@ravikumar10593/

Find my all handles: https://linktr.ee/ravikumar10593

If this article helped you don’t forget to Follow, like, and share it with your friends👍Happy Learning!!

--

--

Ravi Kumar

Hey Techies!, I am here to share my learning about different tech, tools, business and automations, for more details: https://linktr.ee/ravikumar10593