We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 16 | |
| 16 |
| User | Count |
|---|---|
| 66 | |
| 63 | |
| 37 | |
| 34 | |
| 22 |