cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NitinJagtap
New Member

Unable to call Invoke Web Service in Power Automate Desktop to get the Bearer token

Hello Team,

 

I want to get Bearer token with the help of authorization code and other parameters, so I am using Invoke Web Service call but it's throwing an error like below,

I have passed  custom header parameters as a List because it has more than one,

below is the header parameter list,

 

grant_type:authorization_code

client_id:**8b**-***-4857-baed-***742***

redirect_uri=http://localhost/myapp/

scope=https://Ourdomain.onmicrosoft.com/ClientID/user_impersonation

code=%AUTHCODE%

 

Below is the Error :

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Length Required</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Length Required</h2>
<hr><p>HTTP Error 411. The request must be chunked or have a content length.</p>
</BODY></HTML>

 

PADFlow.pngWebServiceCall.pngWorking in Cloud Flow_Http Action.png

 

Same call is working with Power automate cloud with HTTP action and it's returning bearer token also,

 

Please see attached below screen shot for same.

 

Please help me to sort out the issue , struggling from weeks.

 

Regards,

Nitin 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ZS440
Resolver III
Resolver III

HI @NitinJagtap 

Try writing parameters in Body.

Open Advanced and turn off the Encode request body option.
Note that it is on by default.

CleanShot 2022-09-28 at 00.29.44@2x.png

 

View solution in original post

2 REPLIES 2
ZS440
Resolver III
Resolver III

HI @NitinJagtap 

Try writing parameters in Body.

Open Advanced and turn off the Encode request body option.
Note that it is on by default.

CleanShot 2022-09-28 at 00.29.44@2x.png

 

NitinJagtap
New Member

@ZS440 ,

Thanks for your quick suggestion and help . I have passed parameters in Body and  changed the Accept and Content_types as you mentioned and it works smoothly.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Top Kudoed Authors
Users online (4,807)