i am trying to create a bot in python and i want it to sum up the info in google sheets but when i am using api key i can only read and cant edit is there something like api key that will work all the time and will do that i dont need to log in manually? (the error it gives me is error 401)
def main():
key = My_API_Key
discoveryUrl = 'https://sheets.googleapis.com/$discovery/rest?version=v4'
service = discovery.build('sheets', 'v4', http=httplib2.Http(), discoveryServiceUrl=discoveryUrl, developerKey=key)
spreadsheetId = '1z0jzLs0-OXu0I2Cw2BIPEdVzjgGZ_BPx0OcKimmfAhY'
clear_values_request_body = {}
service.spreadsheets().values().update(spreadsheetId=spreadsheetId, range='Sheet1', body=clear_values_request_body).execute()
this is what i have done before and it didnt work