cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
LenkaSalacova
Level: Powered On

Connection to REST API using gateway

Hi,

I have data in PowerApps I need to send to REST API. I am using JSON data format and POST method.

I tried to use HTML action in my Flow but i had issue with following error: "UnresolvableHostName. The provided host name 'prg-xxx-01.srv.int.xxx.com' could not be resolved."
As I access internal REST API I need to use gateway for the connection. As I did not see any option how to use Gateway for HTML action I set up custom connector, created custom connection using my gateway and I am using custom action in my flow. 

I am receiving following error:

500 Internal Server Error

{
"error": {
"code": 500,
"message": "Expression value is invalid. The template field is required.",
"source": "flow-apim-europe-001-francecentral-01.azure-apim.net",
"path": "choose[3]\\when[1]\\choose\\when[1]",
"clientRequestId": "5a3928ef-5948-4587-be33-84d83b752b98"
}
}
 
Any idea how to fix this? I am not super techie or developer so please use "granny" language :))
In general I am not sure if setting up of all the custom stuff is the right way how to solve my case.
 
Thanks 🙂
Lenka
1 ACCEPTED SOLUTION

Accepted Solutions
LenkaSalacova
Level: Powered On

Re: Connection to REST API using gateway

We solved this by creating the connection in Postman, then we imported it to Flow. Not sure what was wrong there before.

View solution in original post

6 REPLIES 6
Community Support Team
Community Support Team

Re: Connection to REST API using gateway

Hi @LenkaSalacova ,

 

Could you share a screenshot of your Flow configuration?

I'm not sure what action you mentioned about HTML action, it seems that the network environment you are in is not able to connect to the host.

For details on using Gateway, please refer to Link below. Note that you need to configure the connection that requires Gateway in Default environment:

https://docs.microsoft.com/en-us/flow/gateway-manage

In addition, if you are creating a custom connector, please refer to online doc and see if it helps:

https://docs.microsoft.com/en-us/connectors/custom-connectors/

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: Connection to REST API using gateway

Please share more details about the REST API you are trying to connect to.

From your post it sounds like ui are trying to connect to a internal service that isn’t routable via the internet and you are holding to access it via the on-premises data gateway.

Is this correct?

- Mark
LenkaSalacova
Level: Powered On

Re: Connection to REST API using gateway

We solved this by creating the connection in Postman, then we imported it to Flow. Not sure what was wrong there before.

View solution in original post

Himanshu_Tyagi
Level: Powered On

Re: Connection to REST API using gateway

Hi  i am also facing the same issue.
You are correct i am doing the same, do you have any solution for the same ?

JordiPrat
Level: Powered On

Re: Connection to REST API using gateway

It's possible connect Flow to internal Rest Api?

Which connector should I use?

Super User
Super User

Re: Connection to REST API using gateway

If you want to connect Flow to an internal REST API and by internal I mean one that lives on your own servers on your own network then you need to ensure two things.

1. The REST API is accessible from the internet. This is key. A REST API is nothing more than a website really, so you need to set up web site publishing to expose the api to the internet. This involves setting up a public DNS entry to give your api a internet reputable url, then your firewall needs to open port 80 and listen for that url, then reverse proxy the request to the web server that hosts your REST API. If you want to increase security then you “may” be able to limit the firewall to only access requests from the Flow service. But I’m not sure if that detail is exposed.

2, Next up all you need to do now is use the HTTP request action to call up your public url for your rest api. Remember this is a premium connector now.

I am not sure if the on-premises data gateway allows you to make HTTP requests through it, I haven’t tried. But the steps above should make it accessible.

As a side note, I think the OP is just missing a field or property called “template” from the request to the API.

Mark

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,293)