Forum Discussion
dataset created from data pulled from restful service can not refresh
- Anonymous7 years ago
Hi shuaho,
I'd like to suggest you move 'get token' method to original query instead use sub query, current power bi service seems not support custom function.
let url="http://api.AAAAA.com/api/1.0/authentication", body = "[{""userName"":""AAAA"", ""password"":""BBBBBB""}]", jsonResult = Json.Document(Web.Contents(url,[Headers =[#"Content-Type"="application/json"],Content = Text.ToBinary(body) , Timeout=#duration(0,2,0,0)])), token = jsonResult[accessToken], location_url = "http://api-test.AAAAA.com/api/1.0/sites", Source= Json.Document(Web.Contents(location_url,[Headers =[Accept="application/json", Authorization=token]]))[result] in SourceBTW, have you configure datasource credentials with 'anonymous' mode on power bi service side?
Regards,
Xiaoxin Sheng
Hi shuaho,
I'd like to suggest you move 'get token' method to original query instead use sub query, current power bi service seems not support custom function.
let
url="http://api.AAAAA.com/api/1.0/authentication",
body = "[{""userName"":""AAAA"", ""password"":""BBBBBB""}]",
jsonResult = Json.Document(Web.Contents(url,[Headers =[#"Content-Type"="application/json"],Content = Text.ToBinary(body) , Timeout=#duration(0,2,0,0)])),
token = jsonResult[accessToken],
location_url = "http://api-test.AAAAA.com/api/1.0/sites",
Source= Json.Document(Web.Contents(location_url,[Headers =[Accept="application/json", Authorization=token]]))[result]
in
Source
BTW, have you configure datasource credentials with 'anonymous' mode on power bi service side?
Regards,
Xiaoxin Sheng
Anonymous thanks for answering!
I need to set a 'GET' request reachable endpoint to make the refresh work.
But you answer helped me, thanks!
- laciodrom_807 years ago
Helper IV
shuaho, Anonymous hi guys,
I'm facing the same problem with two same queries: the first to get the token and the second to get some data. No matter trying to refresh dataset from power bi desktop, but trying to refresh it on power bi service I've got the same credentials issue, also configuring datasource credentials with 'anonymous' mode. :smileyfrustrated:
Could you please give me a suggestion about this?
Thanks a lot in advance
- laciodrom_807 years ago
Helper IV
Here the solution that actually fixed it for me
https://community.powerbi.com/t5/Service/Anonymous-access/td-p/19136