cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

HTTP redirect for 307

I am working with the the http functionality to gather data from a variety of API's to write to Log Analytics. I have one API which requires the ability to handle a 307 redirect (details are below). Currently the Flow errors out at the 307 with a "Temporary Redirect" error. I'm not seeing any options to do http redirect or url forwarding in the http functionality.

 

Handling 307 redirects

When making REST or REST streaming calls, your product will need to handle 307 redirects. Also known as URL forwarding, a 307 Temporary Redirect response provides a new URL for the browser to resubmit a request.

When a 307 redirect happens, you'll need to make the call again with the new URL information. When you do this, you should cache the host and port number for use in future calls with that user/access token. Remember, each call counts toward the rate limit. Consider how your user is interacting with your product. Some users will press a button or choose a setting repeatedly, so if you make a call for every user action, it can impact rate limits very quickly. If a user makes a series of changes in rapid succession, you should only make an API call for the last (most recent) value.

For more information and an example, see How to Handle Redirects.

12 REPLIES 12
Highlighted
New Member

Re: HTTP redirect for 307

I'm having the same problem. I'm starting to learn about Flow, and I'm trying to call my API by building a custom connector. In postman, the api call works fine, but when I try to replicate this call in the custom connector, I get a 307 in my server. Were you able to solve it?

 

The server is IIS

Highlighted
Continued Contributor
Continued Contributor

Re: HTTP redirect for 307

After you make the original HTTP request you can check the Response Code as one of the properties it returns. Does this show you it as a 307? If so, you can query the response body for the redirect url a re-submit the http request, otherwise read the data.

- Mark
Highlighted
New Member

Re: HTTP redirect for 307

Thanks. Did this and worked! 

Highlighted
Regular Visitor

Re: HTTP redirect for 307

I put together a blog post with step-by-step using the Nest API as an example. It won't let me post the URL directly here but it's on the blog site for my employer (CatapultSystems) and is called "how-to-query-the-nest-api-from-logic-apps"

Highlighted
Frequent Visitor

Re: HTTP redirect for 307

Hi @MarkStokes ,

can you tell me how to check the Reponse Code?

Tried with a switch (true if Return Code = 307, else false). But Power Automate does not even execute this step because HTTP Trigger call failed with Code 307.

Thanks!

Highlighted
Regular Visitor

Re: HTTP redirect for 307

The trick on this is to have the step after the original query of the URL execute on fail. In my case it's the JSON parse which occurs after the original check of the URL. I will see if I can update my blog to showcase this with more detail!

Highlighted
Frequent Visitor

Re: HTTP redirect for 307

In my case I can't execute a step after the original query. Of I don't know which settings to change at the HTTP to have a step exected on "fail". 🤔

Highlighted
Regular Visitor

Re: HTTP redirect for 307

The step after the original query is set the Configure Run After option available by the three dots in the top right corner on the step after the original query. Within that I set it to has failed and it's working for me.

Highlighted
Frequent Visitor

Re: HTTP redirect for 307

"Run After" is not available for me when using HTTP..

 

 

Which trigger are you using for HTTP call @CFullerMVP?

Highlighted
Regular Visitor

Re: HTTP redirect for 307

Mine is using the standard HTTP and I'm doing the Configure Run After on the step after the HTTP request which in my case is a parse JSON. The trigger for mine at the start was just a timed request. Can you see the blog post I referenced where I documented this? (It won't let me post the URL here)

Highlighted
Frequent Visitor

Re: HTTP redirect for 307

Thanks @CFullerMVP - I was actually expecting to set the "Run After" IN the HTTP Step.

Configuring it in the following step totally makes sense now!

Thanks for your amazing help 🙂

Highlighted
Regular Visitor

Re: HTTP redirect for 307

I'm glad that I could help on this one, have a great day!

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (8,799)