Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Rj7RhDB+tLDdoWZG7r6Hlr
Power Automate - Building Flows
Unanswered

Dealing with a 302 response in Power Automate

Like (0) ShareShare
ReportReport
Posted on 18 Mar 2020 23:21:31 by 20

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

  • Suggested answer
    MB-30070209-0 Profile Picture
    8 on 01 Dec 2024 at 21:33:45
    Dealing with a 302 response in Power Automate
    I've managed to get it to work for my requirement.
    It appears that the request needed to include an "Accept" header in addition to the "content-type" header I already had.
    Once I added that header to the request, then it handled the 302 response and returned a 200-OK with the expected  body content.
  • TheFactorY Profile Picture
    29 on 09 May 2023 at 07:15:13
    Re: Dealing with a 302 response in Power Automate

    How did you get this working? Same question 🙂

  • MattBarker Profile Picture
    49 on 07 Sep 2022 at 21:11:10
    Re: Dealing with a 302 response in Power Automate

    Please provide the solution to the download rather than just stating "Thanks, now I have this bit working."

  • thomas1992UK Profile Picture
    20 on 19 Mar 2020 at 03:35:22
    Re: Dealing with a 302 response in Power Automate

    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

  • ChristianAbata Profile Picture
    8,947 Most Valuable Professional on 19 Mar 2020 at 00:03:19
    Re: Dealing with a 302 response in Power Automate

    @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

  • thomas1992UK Profile Picture
    20 on 19 Mar 2020 at 00:01:04
    Re: Dealing with a 302 response in Power Automate
    Infact sorry, it is a public api
  • ChristianAbata Profile Picture
    8,947 Most Valuable Professional on 18 Mar 2020 at 23:55:17
    Re: Dealing with a 302 response in Power Automate

    @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

      

  • thomas1992UK Profile Picture
    20 on 18 Mar 2020 at 23:50:38
    Re: Dealing with a 302 response in Power Automate
    It’s an api call with oauth2
  • ChristianAbata Profile Picture
    8,947 Most Valuable Professional on 18 Mar 2020 at 23:48:21
    Re: Dealing with a 302 response in Power Automate

    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.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,786 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,093 Most Valuable Professional

Leaderboard
Loading started