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
Hallo,
i would like to use a REST API to get data from a server. The issue on this api is , that it needs a body to work proper.
let
url = "http:xxxxxxx/ExecuteCollectionQuery",
body = "[
{
""collectionQuery"" : ""(context) =>
context
.Parts()
.OrderBy(part => part.Id)""
}]
",
Source = Json.Document(Web.Contents(url, [
Headers=
[#"Content-Type"="application/json",
#"Accept-Language"="de",
#"Accept"="*/*",
#"Authorization"="Basic cHJvY2FkOnByb2NhZA==",
#"User-Agent" ="ProwerBi"
], Content=Text.ToBinary(body)
]))
in
Source
As you see in the code above i use 'Basic' authentication hardcoded.
In the connector view i do not have any possibility to add a Body
As i told when executing the query above i works in Desktop. But when publishing to the service i cannot set a refesh , because the dataset needs a gateway connection!
If i want to add the source to the gateway, the connection wont work, because the api need a body, there i cannot put a body.
So how can i use a api in the service ?! Somehow i have to fool the service not to use a gateway, because everything is configuted in the dataset ??!
best regards
Christian
Hi. You shouldn't use gateway. You are right. You can go to Schedule Refresh or Dataset configuration and look for Data Source Credentials. You have to specify the credentials only. Because this is a web source you can avoid gateway.
NOTE: If you have on premise data sources added to the power bi dataset you need to turn an option in your gateway to handle hybrid sources (on premise and cloud)
I hope that helps,
Happy to help!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 44 | |
| 44 | |
| 41 | |
| 15 | |
| 15 |