X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d371bc3cbf6c733aa5e7c65a1838088e3ce9102b..af87738e069753c209db476a5a37f450764e9440:/README diff --git a/README b/README index 20ef1e097d..6e7557f45e 100644 --- a/README +++ b/README @@ -7,20 +7,62 @@ License:: Apache 2.0 == Description -The Google API Ruby Client makes it trivial to discover and access supported APIs. - -== Features - -* A feature list goes here. +The Google API Ruby Client makes it trivial to discover and access supported +APIs. == Example Usage - # Some code goes here. + # 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') -== Requirements + # Discover available methods + method_names = client.discovered_api('buzz').to_h.keys -* APIClient has no dependencies. + # Make an API call + response = client.execute( + 'chili.activities.list', + {'scope' => '@self', 'userId' => '@me', 'alt' => 'json'} + ) + status, headers, body = response == Install -* sudo gem install google-api-client +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