Go to file
Bob Aman f336ab34a7 Major update, primarily to add pagination support.
* Added Reference objects to encapsulate API calls.
* Added Result objects to encapsulate API responses.
* Changed the return value of APIClient#execute to Result.
* Changed the method signature of APIClient#execute to support named params.
* Added APIClient#execute! which throws exceptions on error.
* Added automatic parsing code to better allow for complex nested structures.
* Added error parser.
* Added module for pagination in parsers.
2011-07-29 18:07:04 -04:00
bin Major update, primarily to add pagination support. 2011-07-29 18:07:04 -04:00
examples Major update, primarily to add pagination support. 2011-07-29 18:07:04 -04:00
lib/google Major update, primarily to add pagination support. 2011-07-29 18:07:04 -04:00
spec Major update, primarily to add pagination support. 2011-07-29 18:07:04 -04:00
tasks Excluding environment setup file from code coverage. 2011-05-20 23:39:47 +00:00
.gitignore Basic project skeleton. 2010-07-28 19:30:56 +00:00
CHANGELOG Updated CHANGELOG. 2011-05-12 20:23:12 +00:00
LICENSE Basic project skeleton. 2010-07-28 19:30:56 +00:00
README A significant update of the client functionality. 2011-05-04 11:44:35 +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_api('buzz').to_h.keys

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

== Install

Be sure both http://gems.github.com/ and http://rubygems.org/ are in your gem
sources.

For normal client usage, this is sufficient:

sudo gem install google-api-client

The command line interface, the example applications, and the test suite
require additional dependencies. These may be obtained with:

sudo gem install google-api-client --development --force --no-rdoc --no-ri