Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
It appears that you are unable to use PowerQuery in a Scenario where you need:
let
Url="url",
header = [#"x-api-key"="xxxx",#"Content-Type"= "application/json"],
Query="querystring",
body=[encoded_query=Query],
response = Web.Contents(Url, [Headers=header, Content=Json.FromValue(body)]),
Source = Json.Document(response)
in Source^This design with Anonymous credential returns an "Expression.Error: Access to the resource is forbidden." indicating it does not read the header.
let
Url="url",
header = [#"x-api-key"="xxxx",#"Content-Type"= "application/json"],
Query="querystring",
apiKeyName="x-api-key",
body=[encoded_query=Query],
response = Web.Contents(Url, [Headers=header, ApiKeyName=apiKeyName, Content=Json.FromValue(body)]),
Source = Json.Document(response)
in Source^This design with Web API credential returns an "DataSource.Error: Web.Contents with the Content option is only supported when connecting anonymously. Details: DataSourceKind=Web, DataSourcePath=url" indicating I cannot supply a Web API Credential with a Content body.
let
Url="url",
header = [#"x-api-key"="xxxx", #"Content-Type"= "application/json"],
Query="querystring",
body=[encoded_query=Query],
response = WebAction.Request(WebMethod.Get, Url, [Headers=header, Content=Json.FromValue(body)]),
Source = Json.Document(response)
in Source^This design with any credential returns an "Expression.Error: We haven't been given permission to perform actions against this resource." indicating WebAction.Request does not force the method to GET.
This combination is the only valid scenario to request this API.
Any thoughts?
That is correct. As soon as you specify a content body Power Query will automatically change from GET to POST.
Went ahead and submitted an idea. Not sure what the purpose of forcing to POST is.
https://ideas.powerbi.com/ideas/idea/?ideaid=2d5b9bd6-cc43-ec11-a3ee-501ac524503c
There's a big can of worms over there... you could argue the same for PATCH etc. Power Query only provides minimal HTTP request support.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 41 | |
| 33 | |
| 30 | |
| 27 |
| User | Count |
|---|---|
| 132 | |
| 112 | |
| 58 | |
| 57 | |
| 57 |