While writing to a spreadsheet using the gspread library, the following error occurred:
gspread.exception.APIerror: {
"error": {
"code": 401,
"message": "Request had invalid authentication credentials.Expected OAuth2 access token, login cookie or other valid authentication credential.See https://developers.google.com/identity/sign-in/web/devconsole-project.,
"status": "UNAUTHENTICATED"
}
There was no change in behavior before and after, and this error occurred in one of the similar processes.
Why do these errors occur?
Description in exception message
"Request had invalid authentication credentials.Expected OAuth2 access token, login cookie or other valid authentication credential.See https://developers.google.com/identity/sign-in/web/devconsole-project."
The Direct Translation request contained invalid credentials.Use the OAuth2 access token, login cookie, or valid credentials.
Visit https://developers.google.com/identity/sign-in/web/devconsole-project for more information.
Please refer to to to confirm the contents of the credential.
OAuth2 credentials expire in 1 hour (3600 seconds), so if you operate for a long time, they may expire.
© 2024 OneMinuteCode. All rights reserved.