...
The service account will do the communication between the application and Google Calendar (through the v3 API). This account will at a later stage be used to impersonate the calendar user (in the same domain), so that all calendar updates appear to come from the calendar user, instead of the service account.
- Sign in to the account of which you want to share the Google Calendar.
- Visit your account and visit the Google Developers Console
- Set up your project if you haven't already done so and enable the 'Google Calendar API'.
- Select your project and go to "APIs & auth", make sure "Google Calender API" is enabled.
- Click on 'credentials'.
- Click on "Create new client ID". Specify that your application type is service account, and proceed with the setup of the service account.
- At the end of this you should have:
Note | ||
---|---|---|
| ||
| ||
Note | ||
|
Share your calendar with the service account
- Install gem 'google-api-client'
- Sign in to your google account and visit: https://console.developers.google.com
- Click on APIs & auth/Credentials - Create new client ID (under OAuth)
- Select service account
- Copy private key to your local folder (in my case /Users/gijtenbeek/.eventr/<key>
- Sign in to the account of which you want to share the the google calendar
- Click on settings/calendars and 'edit settings' of the calendar you want to share
- In the field 'Share with specific people' add the developer email address: xxxxxx@developer.gserviceaccount.com
- select proper permissions
- Click on SAVE
- In your ruby code, the parameters you pass should contain calendarId. This is settings/calendars/calendar details
- See EventR for a working code sample