Error writing to spsi by gspread

Asked 2 years ago, Updated 2 years ago, 86 views

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?

google-apps-script

2022-09-30 21:47

1 Answers

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.


2022-09-30 21:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.