cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Knowledge Base

Definitive answers from Designer experts.
Announcement | Looking to expand your Alteryx skillset?! Check out the latest set of interactive lessons in Alteryx Academy: Creating Analytic Apps

How to Create Google API Credentials

Creative Director
Creative Director

The following steps detail how to obtain a client ID, client secret, and refresh token that can be used for authentication with Google related tools.

 

1. Open the Google Developers' Console

2. Login with the Google account associated with the data you would like to analyze

3. Create a new project by clicking the My Project dropdown (top-left corner) and selecting Create project (top-right corner of the pop up

4. Enter a Project name of your choosing and click Create

 

Google API Create Project.png

 

5. If you have not already enabled the Google API you will be working with, you can do so by navigating back to the webpage we started on, the Console Dashboard, and clicking Enable API:

 

Google API Enable API.png

 

  • For Google Analytics:
    • Other popular APIs >> Analytics API
  • For Google Drive:
    • G Suite APIs >> Drive API
  • Click Enable:

Google API Enable.png

6. After you've confirmed that your API is enabled you can obtain API credentials by returning to the Console and clicking on Credentials in the left-hand navigation pane next to the key icon

7. Click on the Create Credentials dropdown and select OAuth client ID:

 

Google API Create Credentials.png

 

8. Select the Web application radio button and add https://developers.google.com/oauthplayground as an Authorized redirect URI before clicking Create

9.  At this stage, a pop up should appear where you can copy and save your Client ID and Client Secret

  • You can also find your Client ID and Client Secret by returning to the Developer's Console >> Credentials and clicking the name of the app we just created:

 

 

Google API Credentials.png

 

Google API Client ID and Secret.png

 

10. Go to https://developers.google.com/oauthplayground

11. Click on the gear icon in the top-right corner of the page and click the checkbox for Use your own OAuth credentials, enter the client ID and client secret from step 13, and click close

12. Copy/paste the respective scopes into the Input your own scopes field and click Authorize APIs

14. Click Allow

15. Click Exchange authorization code for tokens and save the Refresh token

16. Test the authorization by sending a request for an available operation from List possible operations

17. If successful, the client ID, client secret, and refresh token that you obtained in the prior steps can now be used for authentication with the Google related tools

Comments

Hi Tara,

 

Thank you for writing this article! It has saved me a considerable amount of time setting up OAuth to connect to Google Sheets! A Gold Star for you!

 

Thanks, Ron


@TaraM wrote:

 

 The following steps detail how to obtain a client ID, client secret, and refresh token that can be used for authentication with Google related tools.

 

  1.    Open https://console.developers.google.com
  2.    Login with the Google account associated with the data you would like to analyze
  3.    Create a new project by clicking the Select a project dropdown (top-left corner) and selecting Create a project...
  4.    Enter a Project name of your choosing and click Create
  5.    From the project Dashboard click Enable and manage APIs
  6.    Select the proper API from the Google APIs list
    1. For Google Analytics tool
      • Analytics API
    2. For Google Sheets tools
      • Drive API
  1.    Click on Enable API
  2.    Click on Credentials
  3.    Click on the New Credentials dropdown and select OAuth client ID
  4.  Click on Configure consent screen
  5.  Enter a Product name and click Save
  6.  Select the Web application radio button, add https://developers.google.com/oauthplayground as an Authorized redirect URI, and click Create
  7.  A window will pop-up with your client ID and client secret; save these for future reference and click OK
  8.  Go to https://developers.google.com/oauthplayground
  9.  Click on the gear icon in the top-right corner of the page, click the checkbox for Use your own OAuth credentials, enter the client ID and client secret from step 13, and click close
  10.  Copy/paste the respective scopes into Input your own scopes and click Authorize APIs:
    1. For Google Analytics tool
    2. For Google Sheets tools
  1.  Click Allow
  2.  Click Exchange authorization code for tokens and save the Refresh token
  3.  Test the authorization by sending a request for an available operation from List possible operations
  4.  If successful, the client ID, client secret, and refresh token that you obtained in the prior steps can now be used for authentication with the Google related tools.

 

Meteor

Is this description still current? The steps described don't seem to resemble the current procedures... Anyone who tried this more recently? I get stuck at step 12.

Just got the steps to work for our account, thanks for the helpful post

Alteryx
Alteryx

Is this current? Looks like Google has changed the whole structure...

Meteoroid

Hi Tara,

          Thanks for sharing it works for me ! Only to keep in mind under credentialsAuthorized redirect URIs - enter https url instead of http than only it would work otherwise you will get error 404.

 

Alteryx Certified Partner

All,

 

I struggled with the setup a bit and made this post.Eventually, I got it working, but I wanted to share this here in case it helps anyone else who has had issues with setup.

 

One component I discovered that's not mentioned above (I think his is a step between 16 and 17) is the following:

 

For anyone else who is doing this, you may need to join the "Allow Risky Access Permissions By Unreviewed Apps" Group or submit a request for authorization by filling-out this form. I elected to join the group in-order to test functionality immediately, and because my use case meets those requirements. 

 

Thanks, 

 

Caleb

Meteor

Great article - works like a charm...

Asteroid

Thanks @TaraM for the share! 

 

I'm trying to configure multiple Google sheets as sources for my Workflows. Every times its a pain to enter the creds and select the workbook and then the sheet. So trying to set this API Credentials feature that's available and your notes has helped.  

 

Few questions to @TaraM @Caleb  

1. But, as per the below info google authorizing guides is there a restriction? 

 

token exp.PNG

 

 A refresh token would expire in 3000 sec. Taking this route will allow only 2 days active tokes ( 50 tokens x 3000 secs each )   without having the need to enter creds. 

 

Other theory: As I would be using only my organization ID does that come under Service accounts as mentioned above ? am not sure of the classification.   Did you run into a situations like this?

 

2. Using the API Creds, does alteryx help users to save the sheets selected in memory in Configuration summary of sheets google sheets input ? So we need not manually configure the tab selections. 

 

3. Share you experience/limitations in using this feature so it will help us understand different eco systems and make our choice. 

 

Thanks

RS 

 

 

 

 

Hi , I followed above steps to download google sheets. But after steps 16 am getting error message as 'The app isn't verified' and am not able to get refresh token. 

 

Could you please help me on this..

 

Thanks

Raj

Alteryx
Alteryx

@JamesEffix  @FredericP @srajkumarece

 

I went through this procedures and documented with pictures which you can view at https://community.alteryx.com/t5/Data-Sources/Output-to-google-sheets/m-p/152071#M8063

When I tried it out in workflows, I discovered that I had to enable both Google Sheets API and Google Drive API to make it work.  I don't know if that's universally the case.

Meteoroid

Hi @dpatel451

 

Which url do I need to enter - what is the purpose of it?  I keep getting the 404 error you mentioned

 

Thanks

Meteoroid

Hey @djb

Screen Shot 2018-04-25 at 12.24.17 PM.png

 

 

 

Meteoroid

Awesome, thanks @dpatel451, works like a charm now!

 

Incidentally, for anyone else reading this, the directions in the Google Analytics "How to Guide" are also very helpful

Atom

Thanks, many stars for you, this save my day.

 

Greetings.

Contributors