Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
I'm using the Google Search Console API to retrieve the information and insert it into Power BI.
I already have OAuth 2.0 client ID credentials with application type "WEB"
In Power BI I selected the option Get data -> Blank query and I have the following query:
let
request = Web.Contents("https://www.googleapis.com/webmasters/v3/sites/mywebsite.com/searchAnalytics/query?startDate=2022-01...", [Headers=[ #"auth_method"="OAuth 2.0", #"client_id"="xxx", #"client_secret"="xxx", #"auth_uri"="https://accounts.google.com/o/oauth2/auth" , #"token_uri"="https://oauth2.googleapis.com/token", #"redirect_uris"="http://localhost"]])
in
request
I tested it in postman with the same url and with the same access data and it works correctly but here in Power BI it gives me the following error:
DataSource.Error: Web.Contents could not get content from 'https://www.googleapis.com/webmasters/v3/sites/mywebiste.com/searchAnalytics/query?startDate=2022-01... 01' (404): Not Found
Details:
DataSourceKind=Web
DataSourcePath=https://www.googleapis.com/webmasters/v3/sites/mywebiste.com/searchAnalytics/query
Url=https://www.googleapis.com/webmasters/v3/sites/mywebiste.com/searchAnalytics/query?startDate=2022-01...
Can you help me?
Thanks!
Solved! Go to Solution.
Hi @CLaudia2_silva ,
There is a similar thread here, please check Pat's reply if it helps:
Solved: Error getting token for external web API (RingCent... - Microsoft Power BI Community
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Thank you for the help. Really the link you suggested managed to unlock the problem. Here's my code, hoping it might help someone else.
let
// Basic auth
authKey = "Bearer xxxxxx",
url = "https://www.googleapis.com/webmasters/v3/sites/mywebsite.com/searchAnalytics/query?startDate=2022-11...",
// bearer token
GetJson = Json.Document(Web.Contents(url, [Headers=[Authorization=authKey, #"Content-Type"="application/x-www-form-urlencoded;charset=UTF-8"], Content=Text.ToBinary("grant_type=client_credentials")])),
#"Convertido em Tabela" = Record.ToTable(GetJson)
in
#"Convertido em Tabela"
Thanks!
Hi @CLaudia2_silva , I am trying to do the same but haven't been succsessful, two questions
1) is the bearer auth key the onhe to get from API centre called developer token
2) what type of "access web content" is to be selected (Annonymous, Basic, Web API, etc)
Thanks,
Moiz
Hi @CLaudia2_silva ,
There is a similar thread here, please check Pat's reply if it helps:
Solved: Error getting token for external web API (RingCent... - Microsoft Power BI Community
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum