Overview
Power Automate allows you to integrate with external services and APIs using HTTP requests. This is useful for:
Calling third-party APIs (e.g., Google, OpenAI, Salesforce, etc.)
Interacting with Microsoft services (e.g., Microsoft Graph API, SharePoint, OneDrive)
Sending data to external applications
Retrieving or updating data from a database or web service
1️⃣ What Are HTTP Requests?
HTTP requests allow Power Automate to communicate with APIs over the internet. They follow this format:
HTTP Method | Description | Use Case |
---|---|---|
GET | Retrieve data from an API | Get user details from a service |
POST | Send data to an API | Create a new record in a database |
PUT | Update existing data | Update a SharePoint list item |
DELETE | Remove data | Delete a record from a system |
2️⃣ Setting Up an HTTP Request in Power Automate
Step 1: Add the “HTTP” Action
- Open Power Automate
- Create a New Flow (Manual, Scheduled, or Automated)
- Add the “HTTP” action
Step 2: Configure the HTTP Request
- Select Method:
GET
,POST
,PUT
, orDELETE
- Enter the API URL
- Add Headers (if required, e.g., authentication)
- Add Query Parameters (if needed)
- Add Body Content (for
POST
andPUT
requests)
Example 1: GET Request (Fetching Data from an API)
Use Case: Retrieve a list of users from a web API.
Field | Value |
---|---|
Method | GET |
URL | https://jsonplaceholder.typicode.com/users |
Headers | Content-Type: application/json |
Expected Response (JSON)
[
{
"id": 1,
"name": "John Doe",
"email": "john@example.com"
}
]
Next Step: Use the Parse JSON
action to extract and use the data.
Example 2: POST Request (Sending Data to an API)
Use Case: Create a new task in an external system.
Field | Value |
---|---|
Method | POST |
URL | https://api.example.com/tasks |
Headers | Content-Type: application/json |
Body |
{
"title": "New Task",
"due_date": "2025-03-10"
}
Next Step: Check the response to confirm task creation.
Example 3: Using API with Authentication (Bearer Token)
Some APIs require authentication using OAuth 2.0 or API keys.
Steps to Use Bearer Token Authentication:
- Retrieve the API token (from API provider)
- Add it in the HeadersjsonCopyEdit
{ "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" }
Example: Calling Microsoft Graph API
Method: GET
URL: https://graph.microsoft.com/v1.0/me
Headers:
Authorization: Bearer <access_token>
Content-Type: application/json
3️⃣ Handling API Responses in Power Automate
After making an API call, the response is usually in JSON format. Use:
“Parse JSON” Action – Extracts specific values from the response
“Condition” Action – Performs actions based on response values
“Apply to Each” Action – Loops through JSON arrays
Example: Extracting Name from API Response
- Add “Parse JSON” Action
- Use Sample JSON Schema
{ "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" } } }
- Use Dynamic Content to reference
name
4️⃣ Best Practices for Using HTTP Requests in Power Automate
Use API Documentation – Always check API provider’s docs for required headers, methods, and body format.
Secure API Keys and Tokens – Store credentials securely using Azure Key Vault.
Handle API Rate Limits – Some APIs limit requests per minute/hour; avoid exceeding limits.
Use Retry Policies – Enable retries in case of temporary failures.
Test API Calls in Postman – Before adding to Power Automate, test in Postman or Graph Explorer.
Summary
HTTP Requests allow Power Automate to call external APIs and automate workflows.
Use GET, POST, PUT, and DELETE methods for retrieving, creating, updating, or deleting data.
Handle authentication using Bearer Tokens or API keys.
Use “Parse JSON” to extract data from API responses.
Follow best practices to optimize API calls and improve security.