Forum Discussion
Anonymous access
- 10 years ago
I had the same issue and logged a support ticket with Microsoft because I wanted to build my own Google Analytics queries (include filters, segments, etc).
Here's the answer I got from the support team:
This is not possible due to constraints with the way Web.Contents stores credentials. They are stored based upon the URL value passed, and there can only be one URL per Dataset. In this case, you're trying to short-circuit a typical oAuth2 flow (one URL) and call the API (another URL). I made an attempt at using RelativePath to 'trick' the service, but stills require that the root of those two endpoints returned a valid HTTP 200 response to indicate connection success. In this case, https://www.googleapis.com returns a 404. Unfortunately, therefore it is not possible as an uploaded PBIX file. I suggest creating a new issue describing what data you would want to see in the Google Analytics content pack (https://app.powerbi.com/groups/me/getdata/services/google-analytics) and we can see about adding it to the model.The only workaround for me so far, is to execute the query elsewhere (for me it's Google Spreadsheet) and connect PBI to that as a data source.
Hi Dmitry
Can you post your code and the issue you're having?
Duncan
I was able to fix it using your method.
let
authKey = "{""Username"":""USERNAME"",""Password"":""PASSWORDGOESHERE"",""LocationID"":""LOCATIONIFNEEDED""}",
url = "https://APILINKGOESHERE.com",
// Uses the authentication/token method to obtain a token
GetJson = Web.Contents(url,
[
Headers = [#"Content-Type"="application/json"],
Content = Text.ToBinary(authKey),
RelativePath="/Authentication/AuthorizeUser"
]
)
in
GetJsonSo thank DuncanP you for your idea!
- DuncanP10 years agoAdvocate II
Glad I could help!
Duncan
- dstramilov10 years agoHelper II
Another helpful hint is to set 2+ seconds delay between API queries in between. In may case delay solved refresh issue.
- dskarthik9 years agoFrequent Visitor
Hi,
I need to login to website to see my orders with username and password. Can you tell me how ot do it?
example: i have www.shopify.com. i am admin of the company profile. I need to get the order and sale details.
I have username and password but it says that authentication failed but i am able to login with the same user name password in the web site, - dskarthik9 years agoFrequent Visitor
Hi,
I need to login to website to see my orders with username and password. Can you tell me how ot do it?
example: i have www.shopify.com. i am admin of the company profile. I need to get the order and sale details.
I have username and password but it says that authentication failed but i am able to login with the same user name password in the web site,