cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thomas1992UK
Frequent Visitor

Dealing with a 302 response in Power Automate

Hi,

 

I want to download a file - when I enter the URL in the browser it downloads.

 

When I use the HTTP request in power automate is returns a 302 error. I have tried the run after failed option but this returns a another http link as opposed to the body content.

 

I have attached the flow and a screenshot from power automate.

 

If I click deal with the 302 redirect response in postman it downloads the file correctly, wondering how to do this in power automate.

 
 

 

Capture11.PNGpowerautomate1.PNGprocore2.PNG

6 REPLIES 6
ChristianAbata
Super User
Super User

hi @thomas1992UK  your link is public? Becouse 302 error is when you have headers to redirect the link, so you need to disable redirect headers from your website.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

It’s an api call with oauth2

@thomas1992UK  mm ok, so in body you need to add the parameter you need to correctly log in. Parameters like this.

client_id=exampleApiKey&client_secret=exampleSecret&username=someUsername&password=WithSomePassword

  



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Infact sorry, it is a public api

@thomas1992UK  another thing you can do is run after error because as I told you the error is an redirect error so maeby you need someting in you header html page.

 

runafter.gif



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Thanks, now I have this bit working.

 

When I get the body from the HTTP request it returns it like the image (binary?), how do I transform this to a viewable image?

 

Thanks,

Tomtext file.PNG

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,230)