More documentation cleanup
[arvados.git] / README.md
1 # APIClient
2
3 <dl>
4   <dt>Homepage</dt><dd><a href="http://code.google.com/p/google-api-ruby-client">http://code.google.com/p/google-api-ruby-client</a></dd>
5   <dt>Author</dt><dd><a href="mailto:bobaman@google.com">Bob Aman</a></dd>
6   <dt>Copyright</dt><dd>Copyright © 2011 Google, Inc.</dd>
7   <dt>License</dt><dd>Apache 2.0</dd>
8 </dl>
9
10 [![Build Status](https://secure.travis-ci.org/google/google-api-ruby-client.png)](http://travis-ci.org/google/google-api-ruby-client)
11 [![Dependency Status](https://gemnasium.com/google/google-api-ruby-client.png)](https://gemnasium.com/google/google-api-ruby-client)
12
13 # Description
14
15 The Google API Ruby Client makes it trivial to discover and access supported
16 APIs.
17
18 # Example Usage
19
20     # Initialize the client & Google+ API
21     require 'google/api_client'
22     client = Google::APIClient.new
23     plus = client.discovered_api('plus')
24
25     # Initialize OAuth 2.0 client    
26     client.authorization.client_id = '<CLIENT_ID_FROM_API_CONSOLE>'
27     client.authorization.client_secret = '<CLIENT_SECRET>'
28     client.authorization.scope = 'https://www.googleapis.com/auth/plus.me'
29     
30     # Request authorization
31     redirect_uri = client.authorization.authorization_uri
32
33     # Wait for authorization code then exchange for token
34     client.authorization.code = '....'
35     client.authorization.fetch_access_token!
36     
37     # Make an API call
38     result = client.execute(
39       :api_method => plus.activities.list'
40       :parameters => {'collection' => 'public', 'userId' => 'me'}
41     )
42
43     puts result.data
44     
45 # Install
46
47 Be sure `http://rubygems.org/` is in your gem sources.
48
49 For normal client usage, this is sufficient:
50
51     $ sudo gem install google-api-client
52
53 The command line interface, the example applications, and the test suite
54 require additional dependencies. These may be obtained with:
55
56     $ sudo gem install google-api-client --development --force --no-rdoc --no-ri