Forum Discussion
Power BI Service - Refresh of data on API using POST method
- 8 years ago
Hi dawidvh,
Based on my research, specify root URL in the url part, and place the remaining URL part into RelativePath parameter, So you can update your code as below. As long as you can use anonymous authentication to access root url of your api, you are able to use anonymous authentication to refresh dataset in Power BI Service.
let authKey = “****”, url =”root url of your api”, body = “{}”, Source = Json.Document (Web.Contents(url,[ Headers = [#”api-key” = authKey, ********* #”Content-Type” = “ “application/json”], Content = Text . ToBinary(body), RelativePath="/api/….." ] ) ), Data = Source[data],For more details, please check this blog.
Regards,
Frank
Hi dawidvh,
Based on my research, specify root URL in the url part, and place the remaining URL part into RelativePath parameter, So you can update your code as below. As long as you can use anonymous authentication to access root url of your api, you are able to use anonymous authentication to refresh dataset in Power BI Service.
let
authKey = “****”,
url =”root url of your api”,
body = “{}”,
Source = Json.Document (Web.Contents(url,[
Headers = [#”api-key” = authKey,
*********
#”Content-Type” = “ “application/json”],
Content = Text . ToBinary(body),
RelativePath="/api/….."
]
) ),
Data = Source[data],
For more details, please check this blog.
Regards,
Frank
Hi dawidvh,
Does that make sense? If so, kindly mark my answer as a solution to close the case please.
Regards,
Frank
- dawidvh7 years agoHelper I
Hey v-frfei-msft,
I came right, thank you. The problem turned out to be the anonymous access to the root of the API that was not allowed. I have used Node-Red as an API proxy which worked well, but I think this change might be required on the Power BI Service to NOT check the anonymous access against against the root of the API at the time of authenticating from the online service.
Have a great day!