I am trying to create an event to a calendar, but get this response:
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "Forbidden",
"reason" : "forbidden"
} ],
"message" : "Forbidden"
This is my request:
event.setStart(new EventDateTime().setDateTime(start));
event.setEnd(new EventDateTime().setDateTime(end));
event.setCreator(new Event.Creator().setEmail("...@..dk));
calendarService.events().insert(emailId, event)
.setOauthToken(GlobalStateController.getGrapevineToken());
I am using Google signIn which works fine, and I have no trouble retrieving events for the different calendars. I use the Google token from the GoogleSignInResponse
.
Furthermore, on iOS the credentials related to my company-user can create events, so I am deducting that its not related to the calendar settings or my user in general.
I see when retrieving calendar events that my accessRole
is reader
which is funny cause I have these 3 credentials.
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
Help is very appreciated.