GAAH - Google Apps API Helper

API Wrapper for Google Apps Marketplace

Currently supports:

Provisioning API (read-only)

Calendar API

Example Code

CLIENT_KEY = '000000000000.apps.googleusercontent.com'
CLIENT_SECRET = 'abcdefghijklmnopqrstuvwx'
DOMAIN = 'example.com'

# Setup
require 'gaah'
Gaah.setup_oauth(CLIENT_KEY, CLIENT_SECRET)
Gaah.domain = DOMAIN

# Get users
users = Gaah::Provisioning::Api.users
user = users.first
user.id    # "https://apps-apis.google.com/a/feeds/example.com/user/2.0/bobert"
user.name  # "Bobert Jones"
user.title # "bobert"

# Get calendar events
xoauth_requestor_id = '[email protected]'
events = user.events(xoauth_requestor_id)
event = events.first
event.title           # "Meeting with Joe"
event.when.start_time # 2013-04-16 13:00:00 -0400

# Get calendar resources *
rooms = Gaah::Resource::Api.resources
room = rooms.first
room.name # "U.S.S. Distill"
room.type # "Conference room"

Resources

Warning: Google documentation links sometimes move without good redirection.

Todo

  • Provisioning API is deprecated, use Directory API
  • Error handling