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,
I am getting exactly the same problem with the Power Bi Service saying that the credentials are not valid yet everything works fine with Power BI Desktop, I was wondering if you could explain to me how you solved this problem?
Thanks and regards,
Luke
Hi Luke.
To get around it you have to use create an intermediatery API that allows anonymous access at root level, that would then in turn connect to your actual data source that doesn't allow anonymous access at root level. Node-Red was perfect for this. Here is a video that you could use to setup Node-Red. https://www.youtube.com/watch?v=zz-jyOih6GA
I will try and make a video about connecting Power BI to this in the next week or two. If this is very urgent, let me know so that we can see how we can help or setup a call.
Twitter: dawidvh