This is a follow on from my thread about a 401 error when using the Google Calendar API and OAuth2, which can be found here
This contains details of the account setup that leads onto my next question, so I wont repeat myself in this thread.
OK, so when when I call the following code to update a Calendar event I get a 403 forbidden error.
for (Event event : events.getItems())
{
event.setSummary("XXX" + event.getSummary());
Event updatedEvent = calendar.events().update(CALENDAR_ID, event.getId(), event).execute();
}
Here is the returned error message:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"message" : "Forbidden"
} ],
"message" : "Forbidden"
}
What have I tried? Well, I have re-read the (rather poor) Google documentation about Service Accounts, re-checked my API Console account settings, tried changing the code that builds the credential (this leads to other errors so is a regression on my previous thread).
In short, nothing works, so is there anything obvious I am missing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…