X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/793e983fbe4f775a6c776ce0b2b3b7b0d245bf7e..7724b20e9a9bfa9154f7242bffa08d8de5bea4ff:/README diff --git a/README b/README index 676990a6d8..6e7557f45e 100644 --- a/README +++ b/README @@ -12,51 +12,57 @@ APIs. == Example Usage - # Initialize the client - require 'google/api_client' - require 'signet/oauth_1/client' - client = Google::APIClient.new( - :service => 'buzz', - :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' - ) + # 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') + ) + 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 + # 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'}, - '', [], {:signed => true} - ) - status, headers, body = response + # Make an API call + response = client.execute( + 'chili.activities.list', + {'scope' => '@self', 'userId' => '@me', 'alt' => 'json'} + ) + status, headers, body = response -== Requirements +== Install -* APIClient has no dependencies. +Be sure both http://gems.github.com/ and http://rubygems.org/ are in your gem +sources. -== Install +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 +sudo gem install google-api-client --development --force --no-rdoc --no-ri