Google Calendar API service token only has reader accessRole

随声附和 提交于 2019-12-25 07:07:02

问题


I'm accessing the Google Calendar API and authenticating with a service token to a calendar owned by an apps-for-domains account. When I call calendar.events.list, I get the response:

{ kind: 'calendar#events',
  etag: [snip],
  summary: [snip],
  description: [snip],
  updated: '2014-11-16T12:33:06.434Z',
  timeZone: 'Europe/London',
  accessRole: 'reader',                <------ this is the problem
  defaultReminders: [],
  nextSyncToken: [snip],
  items: [] }

I would like to be able to write to the calendar. The token's accessRole is reader. How do I grant the service token writer access to the calendar? I have tried using the Google Calendar web UI to give "Make changes AND manage sharing" access to the service-token's email address, but it automatically changes to "See all event details" when I save.


回答1:


The web UI will only allow you to share the calendar with users from the same domain as your Google Apps account. In order to use the service account, you have to give it permission in the Apps Admin, as described here (in the step 4 the name of the option is wrong, I can't remember it exactly, but it's the 3rd link in the page).



来源:https://stackoverflow.com/questions/26957048/google-calendar-api-service-token-only-has-reader-accessrole

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!