'How do I run a script using a different Oauth Token when using a python script for Gspread?

I used a python script for GSpread a while back to move some things around on google sheets. I am trying to use it again with a new google account and started a new project with the new account and set up a new token. The problem is I keep getting this error as if its still trying to use the new token:

Exception has occurred: RefreshError ('deleted_client: The OAuth client was deleted.', {'error': 'deleted_client', 'error_description': 'The OAuth client was deleted.'})

How do I make it so my new token is recognized. In my code I am specifying the new token for the .Oauth() function as well but it seems to be ignoring that?



Solution 1:[1]

It sounds like the app that the API keys are linked to may have been removed.

You should be able to simply generate new API keys for your new account and use them in that script.

Here are the GSpread docs for that. https://docs.gspread.org/en/latest/oauth2.html#enable-api-access-for-a-project

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tim Griffith