cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
J-WVanDerLinden
Regular Visitor

HTTP POST failed - BadRequest, ConnectionFailure - Same URI does work in browser

I'm trying to do a POST to an API using the HTTP action. I've successfully tested the URI using Postman, it uses only query parameters, no headers or seperate verification (key is also in the parameters).


The HTTP action returns an error: BadRequest - ConnectionFailure, Unable to connect to the remote server.

 

Being inexperienced in API calls, this is what I thought to try:

  • Simplifying the HTTP action by putting all the parameters in the URI. Now the URI field is the only filled field.
  • Pasting that URI into the browser. This gives a valid response, which is really puzzling to me. What could be the difference here?
  • Making a custom connector. This also gives a valid response. Unfortunately I'll eventually need to use some functionality the connectors don't support, so I'll need to use the HTTP action.

Does anyone know how to debug this further? And what could cause the HTTP action to fail while the browser and custom connector succeed with the same URI?

 

Edit:

I have copied the Flow several times without changing anything. Now some of these flows consistently work and some consistently don't. My best guess is that each Flow uses its own IP address and some of those are blocked by the receiving API. If anyone can confirm this it would be appreciated.

6 REPLIES 6
ManishJain
Solution Sage
Solution Sage

Hi @J-WVanDerLinden ,

 

Are you sure you are doing POST call with query parameters ? Does it require you to authenticate first and get bearer token ?

 

Thanks

Yes, I am definitely doing a POST call with parameters. The authentication key is one of the parameters. This is not best practice, but hey, it's not my API 😉

ManishJain
Solution Sage
Solution Sage

Hi @J-WVanDerLinden ,

 

Can you please share screenshot of flow and Postman to help you better , please remove token value .

 

Thanks

Hi @ManishJain

Thanks for replying! 

 

Here's the Flow:

J-WVanDerLinden_0-1609879369030.png

 

In the meantime I have copied the Flow several times without changing anything. Now some of these flows consistently work and some consistently don't. My best guess is that each Flow uses its own IP address and some of those are blocked by the receiving API. Would you say that the only explanation? Or the most likely reason?

ManishJain
Solution Sage
Solution Sage

Hi @J-WVanDerLinden ,

 

The API key that you are using is the cause for this. If this still holds good it will work otherwise it wont and I believe there is nothing stopping based on IP . 

 

Thanks

Hi @ManishJain,

 

I don't think it is possible that the API key is the cause. As I have used the same API key in both Flows and one Flow does work consistently.

 

I have asked the owner and the host of the API to check incoming connections and whether they're blocked.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,266)