Showing results for 
Search instead for 
Did you mean: 

Bug: Custom Connector - API call is URL encoded

I've created a custom connector that works perfectly from the Test tab, from Flow, and also from Postman.  It doesn't work from within PowerApps, resulting in a 404 Resource Not Found error.  After plenty of searching and investigation, here's what I've found.


PowerApps include an extra step that the Test tab does not take into account.  While the Test tab sends a GET HTTP request directly to the connector/API to prove it's functioning properly, PowerApps performs a POST to "invoke" first, which in turn sends the GET HTTP request to the connector/API.  The POST includes several "x-ms-" fields, but the issue lies within "x-ms-request-url".  This field contains the url to the connector/API, and that url is being percent-encoded by PowerApps.  For example, single quotes are replaced with %27, left parentheses with %28, and right parentheses with %29.


The connector is expecting /lists/getbytitle('Documents') for example but instead is receiving /lists/getbytitle%28%27Documents%27%29, which results in the 404 error.


To prove the issue lies specifically in the unwanted encoding of x-ms-request-url, I performed the same failing POST as PowerApps using Postman and received the same 404 error.  Within Postman, I modified x-ms-request-url by eliminating the percent encoding and received the expected 200 response with valid results.


I'd suggest that either PowerApps avoid encoding the url in x-ms-request-url, or the connector/connection be modified to gracefully accept the percent encoded url.  I would love to see this one get fixed in the near future so REST API's with parentheses are fully supported.  Or, clearly document that is not/will not be supported.  Of course, if such documentation already exists please post the link for anyone that may be interested.  Thank you.

Status: New
Advocate IV

I got the same issue. I always got 404 with my SharePoint REST API custom connector. This needs to be fixed asap 😞

Frequent Visitor

Another one with a similar issue. URL parameters in a custom connector are getting encoded. Is there, or can we add options to NOT encode parameters somehow.

Regular Visitor

Also here due to this issue, and really hoping I find a fix or workaround cause otherwise i'm dead in the water!

Regular Visitor

So thankfully in my case, I was able to work around it by just passing the "Actual" character I wanted. It was a + in a query string, and using a " " space worked fine!

Regular Visitor

In case anyone else has this issue I managed to get this to work by declaring a relative path parameter for the portion of the url containing the parentheses e.g.{myparenthesessection}?targetid=1234


then when you call the custom connector from powerapps just pass in the the myparenthesessection in plain text e.g. "(target=@target)" along with any query string parameters.