Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Cannot update credentials in PowerBI service when using POST Web

So I use the following POST method to get my data as JSON:

 

 

let
    url = "https://api.adtraction.com/v1/affiliate/transactions/combined",
    body  = "{""fromDate"": ""2018-01-01T03:37:01.621Z"", ""toDate"": ""2018-08-01T03:37:01.621Z""}",
    Parsed_JSON = Json.Document(body),
    BuildQueryString = Uri.BuildQueryString(Parsed_JSON),
    Source = Json.Document(Web.Contents(url,[Headers = [#"Content-Type"="application/json", #"X-Token"="XXX"],  Content = Text.ToBinary(body) ] ))
in
    Source

 

Everything works perfectly in PowerBI Desktop. I can manually refresh data at any time.

However, when published in PowerBI Service, it says that credentials are invalid. This source does not require credentials, it used API Token. More specifically, the error looks like this:

 

Any suggestions what's happening here?