web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / [Walkthrough] How to u...
Power Automate
Unanswered

[Walkthrough] How to use Invoke Web Service with multipart/form-data in Power Automate Desktop

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Summary 

A common requirement when sending/receiving data is to use an existing service. However, calling an external API may require a specific configuration. In this post I will explain how to configure Power Automate Desktop to use a REST API as service using the Invoke Web Service action.

 

Prerequisites 

  1. Visual Studio 2019 with .NET cross-platform development workload 
  2. Postman 
  3. Power Automate Desktop 

 

Requirements 

The requirement for this walkthrough will be edit a profile information by submitting data using the following: 

URL 

[base-url]/profile/info 

Method 

POST 

Content type 

multipart/form-data 

Form data 

name, surname

 

Configuring the API

You can skip this step if the API that will be consumed is already configured. 

The first step is to make sure that the API method is configured correctly to allow receiving data into chunks. In ASP.NET Core this is done by adding the Consumes attribute to the publicly facing method, like so: 

 

[ApiController] 
[Route("[controller]")] 
public class ProfileController : ControllerBase 
{ 
	[HttpPost] 
	[Consumes("multipart/form-data")] 
	[Route("info")] 
	public async Task<IActionResult> PostInfoAsync() 
	{ 
		// Do work 
		return Ok(); 
	} 
} 

 

 

Testing the API method using Postman

You can make sure that you have configured the method correctly with Postman by setting the body to form-data and providing a list of keys and their corresponding values. This will useful later when you need to configure the Invoke Web Service action in Power Automate Desktop.

 JesusFMSFT_0-1625580469109.png

 

After you have provided the data, click on Send to submit the request to the service. You should receive a 200 OK response from the service if everything was configured correctly.  

Postman provides snippets of all kinds, but the one that you are interested in is HTTP. 

JesusFMSFT_1-1625580469106.png

 

 As you noticed, the snippet not only specifies in Content-Type the type of data that you want to submit, but also a boundary parameter. You need to include this as is in the Invoke Web Service action to work as expected. 

 

Calling API method using Power Automate Desktop 

After making sure that the API method works, the last step is to simply configure the action in Power Automate Desktop like so: 

 

JesusFMSFT_2-1625580469115.png

 

Encoding request body

One important step is to make sure that the option to encode the request body matches the configuration at the receiving end. 

Encoding a request body means that Power Automate Desktop will encode the entire body, including query-string values. If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. 

Enabling the Encode request body option in the Advanced section converts characters that are not allowed in a URL into character-entity equivalents. For example, when the characters < and > are embedded in a block of text to be transmitted, they are encoded as %3c and %3e respectively. 

JesusFMSFT_3-1625580469112.png

 

 

I have the same question (0)
  • yoko2020 Profile Picture
    495 on at

    Show us example to upload files using invoke web service.

  • tkuehara Profile Picture
    667 on at

    Hi @yoko2020 

     

    I guess this is gonna depend on the API you're currently using but here is an example from a project I'm working at:

    First, I send a request to signalize to the API that I'm gonna send a file to it. If successful, the API returns the URL I must send the file to:

    tkuehara_0-1625607316067.png

    Second, I upload the file to the URL using curl:

    tkuehara_1-1625607443245.png

    tkuehara_2-1625607509940.png

     

  • yoko2020 Profile Picture
    495 on at

    If using curl i can do that.

    What i ask is uploading files pure using only action  invoke web service.

    I am just hoping they can integrate this feature in that action.

    No need to use another solution when dealing with upload files.

     

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 801

#2
Valantis Profile Picture

Valantis 602

#3
Haque Profile Picture

Haque 581

Last 30 days Overall leaderboard