Skip to content

Instantly share code, notes, and snippets.

@laradevitt
Created June 15, 2019 14:06
Show Gist options
  • Save laradevitt/134df2d28c778cd8b32df89767d113dd to your computer and use it in GitHub Desktop.
Save laradevitt/134df2d28c778cd8b32df89767d113dd to your computer and use it in GitHub Desktop.
(Steps) Google API Console: Access Google Sheet data from your app

Set up

To access data from a Google Sheet with your app, you will need to create a service account and download a credentials file from the Google API Console.

  1. Create a Google spreadsheet.
  2. Go to the Google APIs Console.
  3. Create a new project and navigate to it.
  4. Click Enable APIs and Services. Enable the Google Drive API.
  5. In the Create credentials options, select Help me choose. You are using "Google Drive API" from a "Web server" to access "Application data".
  6. Add credentials to your project. Name the service account and grant it a Role of "Project" > "Editor".
  7. Download the credentials file (JSON format).
  8. Copy the credentials file to your code directory and rename it to client_secret.json
  9. Copy the value of client_email from the credentials file. Back in your spreadsheet, click the Share button in the top right, and paste it into the People field to give it edit rights. Hit Send.

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment