Forum Discussion
Phoenixke
8 years agoFrequent Visitor
Refreshing data from REST API
Hi, I've been using PowerBI Desktop to call on reports from Kronos Workforce Ready. They have a pretty straight-forward REST API (https://secure.workforceready.eu/ta/docs/rest/) and using the bla...
- Anonymous8 years ago
Phoenixke,
When your API requires the use of POST with specific headers to return a successful response, it doesn't support to refresh the dataset in Power BI Service, please vote up the following idea.
https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/19033174-scheduled-refresh-should-work-on-web-apis-web-con
Regards,
Lydia
Phoenixke
8 years agoFrequent Visitor
roberthurd: I'm using parameters in mine but you can hardcode if you wish. This one works quite well for me:
let
WFRtoken = "Bearer " & Json.Document(Web.Contents("https://secure.workforceready.eu/ta/rest",
[Headers=[#"Accept"="application/json", #"Content-Type"="application/json", #"Api-Key"="apikey"],
Content=Text.ToBinary("{""credentials"": {""username"": ""user"",""password"": ""pass"",""company"": ""shortname""}}"),
RelativePath = "/v1/login"]))[token]
in
WFRtokenroberthurd
8 years agoNew Member
Phoenixke that's really great. Your query works well. Thank you.