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
I have this exact same issue.
The "authentication" is baked into the Power Query code itself through the API key, so setting the authentication method to anonymous works perfectly in Power BI desktop. However I get the same invalid credentials errors when trying to refresh from Power BI.
My code is similar:
Source = Json.Document(Web.Contents("https://myapi.com/api/method", [Headers=[#"X-API-Key"="Some_GUID"]])),
If anyone can come up with a workaround for this, I'd be very grateful as well!
Duncan
EDIT:
Just to note, anonymous authentication works fine at the root level of the api (https://myapi.com/api) and simply lists the methods. However in the Power BI refresh, it tries to load the method url which of course fails without the api key.
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.
- DuncanP10 years agoAdvocate II
Well that's actually fixed it for me, so thanks!
I've modified my json call to:
Source = Json.Document(Web.Contents("https://myapi.com", [Headers=[#"X-API-Key"="Some_GUID"],
RelativePath="/api/method"])),which now allows it to authenticate properly. In this case I'm lucky that the root url of the api works with anonymous access.
Duncan
- Anonymous4 years agoNot applicable
5 years later this is still useful. Thank you so much 🙂
- dstramilov10 years agoHelper II
DuncanP,
I am trying to solve the same issue, but still getting error, do you mind to write a bit more how you solved this problem please.
Dmitry
- DuncanP10 years agoAdvocate II
Hi Dmitry
Can you post your code and the issue you're having?
Duncan
- marteken9 years agoRegular Visitor
Hi fso,
Im having the same issue that I can only refresh my data in the desktop version but not online.
Coule you please elaborate a little bit more when you say that you use google sheets to execute the query?
Thanks!
- Anonymous6 years agoNot applicable
Hey, Im having the same issue right now.
My base URL (https://api.applicationinsights.io/v1/apps) returns 404 so I need to find workaround.
Do you think that I could use Google spreadhsheet as a workaround?
Thanks,
Rafal