Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
juliovidigal
Advocate I
Advocate I

Refresh - API GOOGLE ANALYTICS

Good afternoon!

 

I'm making a call in google analytics api, to refresh my token.

In powerbiDesktop, it works perfectly, in 2 modes!
But when I publish this in app.powerbi.com it returns me error.

Any idea?

 

let

app_credentials ="client_id=XXXXXXm&client_secret=XXXXXX",

url = app_credentials & "&refresh_token=" & "xxxxxxxx" & "&grant_type=refresh_token",
GetJson = Web.Contents("https://www.googleapis.com/oauth2/v4/token",
[
Headers = [#"Content-Type"="application/x-www-form-urlencoded"],
Content = Text.ToBinary(url)
]
),
FormatAsJson = Json.Document(GetJson)[access_token]
in
FormatAsJson

 

Return this error: Failed to update data source credentials: Web.Contents failed to get contents from 'https://www.googleapis.com/oauth2/v4/token' (404): Not Found

 

And

 


let

app_credentials ="client_id=XXXXXXm&client_secret=XXXXXX",

url = app_credentials & "&refresh_token=" & "xxxxx" & "&grant_type=refresh_token",
GetJson = Web.Contents("https://accounts.google.com/o/oauth2/token",
[
Headers = [#"Content-Type"="application/x-www-form-urlencoded"],
Content = Text.ToBinary(url)
]
),
FormatAsJson = Json.Document(GetJson)[access_token]
in
FormatAsJson

 

Return this error: Failed to update data source credentials: Web.Contents failed to get contents from 'https://accounts.google.com/o/oauth2/token' (405): Method Not Allowed

 

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @juliovidigal,

 

Current power bi service not support custom function and query parameters. I think your issue may related to it.(these parameters not available on power bi service, so your methods get the error or wrong result)

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors