At the moment there is no authentication that's required to access your Sheety endpoint. That means anyone could read and write to your "My Workout" Google Sheet.

1. Add either "Basic Authentication" or "Bearer Token" to your Sheety endpoint to secure it.  You can hardcode the token in your code for now while you test your code. Once you're sure it works, we can add it to the environment variables in the next step.

What is Bearer authentication?

Bearer authentication (also known as token authentication) is an HTTP authentication scheme that involves security tokens. The name Bearer authentication basically means give access to the bearer of this token. The security token or bearer token is just a cryptic string. An example of a bearer token would be a string that could look something like this:

"AAAAAAAAAAAAAAAAAAAAAMLheAAAAAAA0%2BuSeid%2BULvsea4JtiGRiSDSJSI%3DEUifiRBkKG5E2XzMDjRfl76ZC9Ub0wnz4XsNiRVBChTYbJcE3F"

The idea is that whoever has the secret token, has permission to interact with the spreadsheet. A client - like your browser or mobile app - would then send this security token in the Authorization header when making requests to Sheety's server.


2. Using the Sheety documentation on authentication to update your Python code to authenticate your request.

HINT: You'll need to read the relevant section on the request module documentation to do this.

Basic Authentication: https://requests.readthedocs.io/en/master/user/authentication/#basic-authentication

Bearer Authentication: https://stackoverflow.com/questions/29931671/making-an-api-call-in-python-with-an-api-that-requires-a-bearer-token


SOLUTION