Open testing-blaze opened 3 years ago
There might be a 'token' folder. Rename it, then run your code again to force google web login. See e.g. https://stackoverflow.com/questions/70569649/get-access-token-scope-insufficient-error-migrating-to-people-api
I am able to read my values. However when I am trying to update any cell i get subject error.
Sample Name
QuickStarts
Expected Behavior
Performing updating of cell and data should be updated to the cell.
Actual Behavior
Getting below error
Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden PUT https://sheets.googleapis.com/v4/spreadsheets/1sCHkcsZJ7CjgQPyHjkmqKtHyHgWNE/values/B4?valueInputOption=RAW { "code" : 403, "errors" : [ { "domain" : "global", "message" : "Insufficient Permission", "reason" : "insufficientPermissions" } ], "message" : "Request had insufficient authentication scopes.", "status" : "PERMISSION_DENIED" } at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146) at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:118) at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:37) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:428) at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1108) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:514) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:455) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:565)
Specifications
Code Snippet
private static final String APPLICATION_NAME = "Google Sheets API"; private static final JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance(); private static final String TOKENS_DIRECTORY_PATH = "tokens"; static final String spreadsheetId = "1sCHkcsZJ7CjgQPyHjkmqKtHyar0kj8ueeUHgWNE"; static final String range = "Product-Analyzer!A4:L4"; public static List<List