Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

  1. Sign in to the account of which you want to share the Google Calendar.
  2. Visit your account and visit the Google Developers Console
  3. Set up your project if you haven't already done so and enable the 'Google Calendar API'.
  4. Select your project and go to "APIs & auth", make sure "Google Calender API" is enabled.
  5. Click on 'credentials'.
  6. Click on "Create new client ID". Specify that your application type is service account, and proceed with the setup of the service account.
  7. At the end of this you should have:


Note
titleYou should now have
  • Client ID (
Note
  • Client ID, in the form: xxx.apps.googleusercontent.com)
  • email address in the form: (xxx@developer.gserviceaccount.com)
  • A private key file

Share your calendar with the service account

 

 

 

  1. Install gem 'google-api-client'
  2. Sign in to your google account and visit: https://console.developers.google.com
  3. Click on APIs & auth/Credentials - Create new client ID (under OAuth)
  4. Select service account
  5. Copy private key to your local folder (in my case /Users/gijtenbeek/.eventr/<key>
  6. Sign in to the account of which you want to share the the google calendar
  7. Click on settings/calendars and 'edit settings' of the calendar you want to share
  8. In the field 'Share with specific people' add the developer email address: xxxxxx@developer.gserviceaccount.com
  9. select proper permissions
  10. Click on SAVE
  11. In your ruby code, the parameters you pass should contain calendarId. This is settings/calendars/calendar details
  12. See EventR for a working code sample