Skip to content
Advertisement

Updating spreadsheet data with Google Spreadsheet api and php suddenly not working with authentication error

In a form which takes input and updates the value in a spreadsheet. It was working fine before but suddenly stopped working with this error message:

JavaScript

According to other questions and answers it is because of authentication problem, but the form was working for 5 years with the same authentication so it is confusing. Is there any other reason for which the form is not updating?

here is the code included

JavaScript

Advertisement

Answer

The caller does not have permission

means exactly that. Which ever user you used to authorize this code does not have permission to access that sheet. Authorize your application with a user that has access or grant that user access.

Service accounts need to be preauthorized. The most common way to do that is to take the service account client id and share the file with it though the google drive web application. If someone removed the service accounts access to the file. The service account will no longer have access.

I would double check that it still has access.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement