Skip to content

Instantly share code, notes, and snippets.

@rserna2010
Last active August 29, 2015 14:26
Show Gist options
  • Save rserna2010/48b25ed2ac8a00cc039c to your computer and use it in GitHub Desktop.
Save rserna2010/48b25ed2ac8a00cc039c to your computer and use it in GitHub Desktop.
require 'Gmail'
Gmail.client_id = ENV['OMNIAUTH_CLIENT_ID']
Gmail.client_secret = ENV['OMNIAUTH_CLIENT_SECRET']
Gmail.refresh_token = refresh_token
service = Google::APIClient.new.discovered_api('gmail', 'v1')
Gmail.client.execute(
:api_method => service.users.labels.list,
:parameters => {'userId' => 'me'},
:headers => {'Content-Type' => 'application/json'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment