Go to file
Bob Aman 73002ccc14 Updating addressable dependency.
git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@66 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef
2010-10-12 23:07:40 +00:00
bin Updating CLI and explorer to match recent changes. 2010-10-12 23:07:36 +00:00
examples/sinatra Updating CLI and explorer to match recent changes. 2010-10-12 23:07:36 +00:00
lib/google Updated version sorting code and added authorization shortcuts. 2010-10-12 20:39:09 +00:00
spec Added check for major.minor.tiny version format. 2010-10-12 20:41:14 +00:00
tasks Updating addressable dependency. 2010-10-12 23:07:40 +00:00
.gitignore Basic project skeleton. 2010-07-28 19:30:56 +00:00
CHANGELOG Basic project skeleton. 2010-07-28 19:30:56 +00:00
LICENSE Basic project skeleton. 2010-07-28 19:30:56 +00:00
README Updated version sorting code and added authorization shortcuts. 2010-10-12 20:39:09 +00:00
Rakefile Updating error messages to match. 2010-08-19 23:21:18 +00:00

README

== APIClient

Homepage::  google-api-ruby-client[http://code.google.com/p/google-api-ruby-client/]
Authors::   Bob Aman (mailto:bobaman@google.com), Matt Pokrzywa (mailto:mattpok@google.com)
Copyright:: Copyright 2010 Google Inc.
License::   Apache 2.0

== Description

The Google API Ruby Client makes it trivial to discover and access supported
APIs.

== Example Usage

  # Initialize the client
  require 'google/api_client'
  require 'signet/oauth_1/client'
  client = Google::APIClient.new(
    :service => 'buzz',
    # Buzz has API-specific endpoints
    :authorization => Signet::OAuth1::Client.new(
      :temporary_credential_uri =>
        'https://www.google.com/accounts/OAuthGetRequestToken',
      :authorization_uri =>
        'https://www.google.com/buzz/api/auth/OAuthAuthorizeToken',
      :token_credential_uri =>
        'https://www.google.com/accounts/OAuthGetAccessToken',
      :client_credential_key => 'anonymous',
      :client_credential_secret => 'anonymous'
    )
  )
  client.authorization.fetch_temporary_credential!(
    :additional_parameters => {
      'scope' => 'https://www.googleapis.com/auth/buzz'
    }
  )
  redirect_uri = client.authorization.authorization_uri(
    :additional_parameters => {
      'domain' => client.authorization.client_credential_key,
      'scope' => 'https://www.googleapis.com/auth/buzz'
    }
  )
  # Redirect user here
  client.authorization.fetch_token_credential!(:verifier => '12345')

  # Discover available methods
  method_names = client.discovered_service('buzz').to_h.keys

  # Make an API call
  response = client.execute(
    'chili.activities.list',
    {'scope' => '@self', 'userId' => '@me', 'alt' => 'json'}
  )
  status, headers, body = response

== Requirements

* APIClient has no dependencies.

== Install

* sudo gem install google-api-client