UPE Candidate Tracker is a slack bot used in University of California, Berkeley's Computer Science Honors Society, UPE - NU Chapter. Currently, this is a Flask application that uses Slack and Google Sheets API to enable quick access for candidates a list of their requirement on their track towards members.
In order to correctly access our spreadsheet, we need to install a couple packages listed below
pip install flask
pip install gspread
pip install oauth2client
Creating API endpoint to access the Google Sheets
-
Go to Google Cloud Console and create a new project. Name the project as desired
-
Go to the dashboard of the project by clicking the top left dropdown
-
Search for
Google Drive API
using the search bar in the middle of the screen -
Enable Google Drive API and click
Create Credentials
on the left side -
Fill the form as indicated
-
Download the JSON credentials file created and rename it into
creds.json
-
Search for
Google Sheets API
using the search bar and click Enable -
Copy the
client email
value from our JSON file and share it with the desired spreadsheet
This should allow the API to have access to the sheet
Retrieve Slack Bot Information
-
Go to Slack > Your Apps (top right) > Create New App
Create a new app for the desired workspace -
Scroll to
Verification Token
and copy it -
Click on
Add featuress and functionality
>Slash Commands
>Create New Command
Fill out the contents indicated -
Go back to the app's
Basic Information
> clickInstall App to Workspace
-
Using a browser, go to the desired workspace and copy the
Team ID
specificed ashttps://app.slack.com/client/<team id here>/
Like any Flask app export the desired environment variables.
Fill in the values with the Slack IDs specified above
export SLACK_VERIFICATION_TOKEN=your-verification-token
export SLACK_TEAM_ID=your-team-id
export FLASK_APP=upe-tracker.py
See Berkeley OCF's docs on app hosting
- Wallace Lim
- Leon Ming