0
votes

I'm on the google sheets quickstart page and when I click on "Enable Google Sheets API" button it comes up with a menu called "Configure your OAuth client". There's a dropdown menu with a bunch of options like web browser, web server, ios, chrome app, etc. I'm new to programming with API's so I have no idea what this means. Which one should I use?

I'm making a web scraping program in the Eclipse IDE with Selenium and I want to dump my data I scrape into a google sheet. Any help would be appreciated

URL: https://developers.google.com/sheets/api/quickstart/java

1

1 Answers

0
votes
  • In order to use any Google API, you need to create a Google Cloud Platform Project
  • Google offers two authentication ways
  • In most cases you will want use OAuth2 for safe authentication
  • You will need to obtain Credentials that will be used by the App to obtain the access and refresh tokens
  • To obtain credentials you need to set up the conset screen of you App first, as described here
  • The exact way depends on several factors, e.g. either you want to publish an external application or just use it for yourself and on which type of device you want to use it.
  • For most internal applications specifying the application type, the Application name and Scopes (can be edited later) is enough
  • The possible scopes for the Sheets API are listed here
  • For the beginning the easiest will be if you follow the quickstart for Java and set-up the Consent Screen by simply clicking on the Enable the Google Sheets API button
  • This will do all the configuration automatically in the background

Now, as the application type:

  • This depends strongly on how you want to implement the application - your choice will influence how the user will be redirected after authentication.
  • For testing on your local machine, Desktop App will mostly be the correct choice
  • I am not very familiar with Selenium, but for this kind of integration Web Server Application is likely the correct choice.
  • I recommend you to read how Google implements Web Server and Desktop applications to decide which type would be the appropiate one for you.