Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (17.6k points)

I am trying to connect to youtube/google analytics using the OAuth method and power bi. I have managed half way and I need some help. This is where I am at:

I obtain an authorization token manually using:

https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/yt-analytics.readonly&response_type=code&access_type=offline&redirect_uri=urn:ietf:wg:oauth:2.0:oob&approval_prompt=force&client_id={clientid}

Once I have that, I put it in my query and I am able to get both the access_token and the refresh_token:

Now, if I understand the documentation correctly, when the access_token expires after an hour, I can then use the refresh_token I got, to create a new access_token automatically,

Is that possible to do in Power Query? Has anybody tried?

I am completely clueless as to how to do that and I am not a developer so my skills are limited :(

Any help is appreciated! 

1 Answer

0 votes
by (47.2k points)
  • you can send a HTTP POST and you are able to get a new access token using a refresh token

POST https://accounts.google.com/o/oauth2/token client_id={ClientId}&client_secret={ClientSecret}&refresh_token={RefreshToken}&grant_type=refresh_token

  • In this way you will getting a response:

{ "access_token" : "ya29.1.AADtN_XK16As2ZHlScqOxGtntIlevNcasMSPwGiE3pe5ANZfrmJTcsI3ZtAjv4sDrPDRnQ", "token_type" : "Bearer", "expires_in" : 3600 }

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...