Reputation: 11
I am new to Google Calendar API, I had created the Service Account for OAuth process and then I get the access token using JWT. Then I try to fetch the calendar list but the response didn't fetch the calendar list. I am using business account with domain. I want to view my organization user calendar list.
Response:
{
"kind": "calendar#calendarList",
"etag": "\"p3208dll2qn2d60g\"",
"nextSyncToken": "CICG1qLVxNMCEjBtZWV0aW5nQHBvbGV0dXMtY2FsZW5kYXIuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20=",
"items": []
}
The Organization user having the SuperAdmin access. And I tested with my normal gmail account using service accounts it works for all api requests.
Upvotes: 1
Views: 1660
Reputation: 116868
Remember a service account is not you. A service account is a dummy user it has its own Google calendar account. Assuming that you did share the calendar in question with the Service account it may not have been added to the calendar list.
All calendar list is the list on the bottom left hand side of the GUI. Sometimes when you share a calendar with a service account it doesn't get added properly to the calendar list. You can add it yourself via the service account by running calendarlist.insert
Assuming that you have not granted the server account permissions to read the calendar you will need to do so by sharing it like you would any other user using the service account email address.
Upvotes: 1