-
Notifications
You must be signed in to change notification settings - Fork 0
Set up Google Sheet and Google Sheets API
Nicholas Bottone edited this page May 5, 2023
·
1 revision
- Create a Google Sheet that you have edit access to for storing/sharing tournament data.
- Create a Google Cloud Platform project and enable both the Google Drive API and Google Sheets API.
- Click on credentials and create a "Service account". Name the service account whatever you want. Take note of the service account's email address: share your original Google Sheet with this email address and provide edit access. Skip over step two "Grant this service account access to project" by just pressing continue. On step three, click "Create Key" and download a JSON key to your computer.
After creating a Google Cloud Platform (GCP) service account and downloading a private key as a JSON file, you will want to look for two specific strings within the file. You are looking for the private key and the client email.
- Make sure the proper private key and client email are saved in your
.env
file. - Share (with editing access) the desired Google Sheet with the client email.
- Copy the sheet id from the Google Sheets URL. For example, if the URL is
https://docs.google.com/spreadsheets/d/1YN8b-bpMoQTo_GTl2xIxl0VwrHN_BnM0j4s0nMCxcvA/edit
, then the sheet id is1YN8b-bpMoQTo_GTl2xIxl0VwrHN_BnM0j4s0nMCxcvA
. Make sure the proper sheet id is saved in your.env
file.
You must open your Google Sheet and fill in the "Schedule" worksheet with the necessary match schedule for your event!
Also, make sure that your "Schedule" and "Matches" worksheets are formatted correctly (the header row should be unmodified). To regenerate these worksheets, you may delete them from your Google Sheet and relaunch the executable.