Showing results for 
Search instead for 
Did you mean: 
Not applicable

Connection to REST API using gateway


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 '' 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": "",
"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 🙂

Accepted Solutions
Not applicable

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

Community Support
Community Support

Hi @Anonymous ,


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:

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


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.
Skilled Sharer
Skilled Sharer

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
Not applicable

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

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

It's possible connect Flow to internal Rest Api?

Which connector should I use?

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.

Regular Visitor

Solved. Never got a complete answer so posting this step-by-step that solved it for me...

2020-04-21 16_41_24-screen 1.png



2020-04-21 16_41_24-screen 2.png








2020-04-21 16_41_24-screen 3.png2020-04-21 16_41_24-screen 4.png

Helpful resources

MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

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

Users online (1,002)