Google

This is a short guide on how to create a robot which accesses various Google APIs, which can be used to read and write to services by Google. This includes YouTube, Google Drive, Blogger, and many more.

First, log into http://code.google.com/apis/console with your Google account, or create a new account if necessary. Create a new project by clicking "Create Project...".

Choose API Access in the left-hand menu, then click "Create an OAuth 2.0 client ID...".

A configuration screen now appears. Input any relevant information; only a product name is mandatory.

Click next and a new form will appear. Choose "Web Application" as the application type and write the OAuth callback URL in the field labeled "Your site or hostname". The callback URL is the path OAuthCallback under the folder in which the Management Console is deployed. For instance, if running with an embedded Management Console, it runs at http://localhost:50080/ and the callback URL is http://localhost:50080/OAuthCallback. Press Enter after inputting your callback URL. The "Redirect URL" at the bottom of the form will now change to the URL you input. Remember to choose http:// or https:// from the drop down menu, depending on which protocol your Management Console is using.

After clicking "Create client ID", a page with Application details is opened. On this page it is important to take note of the Client ID and Client Secret which will be used as Consumer Key and Consumer Secret in the Management Console later on.

Now, open the Management Console. Make sure to open the Management Console at the URL specified for the app. That would be http://localhost:50080 for the information used above. Then navigate to the OAuth Repository and click "New Application".

Select a name for the new application and choose Google as the service provider. Consumer Key and Consumer Secret should respectively be set to the Client ID and Client Secret noted earlier. The Callback URL should already be correctly stated.

In the Scope field, we state the Google API permissions required from the app user. In the picture below the basic user information has been requested. A comprehensive list of APIs and the scope associated with each one is given through Google APIs Discovery Service. A list of available APIs as of December 2012 is given in a table at the bottom of this page. The table gives a description of each API, a link to the documentation, as well as the scope URL.

After being saved, the application appears in the repository. Click on the icon under "Add User" to add a user to the application.

Choose a name for the user and click next.

Now, click the authorization link.

This will open a page where the app will request permission to access certain aspects of your Google account, as specified in through the scope of the application.

Authorizing the app will forward you to the OAuth callback page of the Management Console.

Close the OAuth callback page, returning to the Management Console. Click Next in the wizard and you will see the access token and refresh token granted for accessing Google on the user's behalf. Copy these tokens into a notepad, since they will not be accessible later for security reasons.

After clicking Finish, you should now see a user in the Users section of the OAuth tab.

Now, open Design Studio and create a new robot or open the robot you would like to access the chosen Google API. For the robot to be able to use the Google API, make sure that it has an input variable of the complex type "OAuthCredentials". The variable should have "Google" as the service provider name. Also, input the access token and refresh token along with the Client Key and Client Secret noted earlier. The latter two should be used as consumer key and consumer secret respectively.

Then, make sure to configure the robot to use OAuth credentials.

The robot should now be able to access the chosen Google API. As an example try typing https://www.googleapis.com/oauth2/v1/userinfo in the address bar of the browser view and pressing Enter. This should return an JSON page with basic user information.

To learn more about the Google APIs, try experimenting with Google's OAuth 2.0 Playground. Also, the links to documentation in the table below are helpful resources to learn more about each API. Once a robot has been built, it is possible to schedule execution of the robot in the Management Console.

API Description Documentation Scope
Search API For Shopping Manage your Ad Exchange buyer account configuration https://developers.google.com/ad-exchange/buyer-rest https://www.googleapis.com/auth/adexchange.buyer
AdSense Management API View and manage your AdSense data https://developers.google.com/adsense/management/ https://www.googleapis.com/auth/adsense
AdSense Management API View your AdSense data https://developers.google.com/adsense/management/ https://www.googleapis.com/auth/adsense.readonly
AdSense Host API View and manage your AdSense host data and associated accounts https://developers.google.com/adsense/host/ https://www.googleapis.com/auth/adsensehost
Google Analytics API View and manage your Google Analytics data https://developers.google.com/analytics/ https://www.googleapis.com/auth/analytics
Google Analytics API View your Google Analytics data https://developers.google.com/analytics/ https://www.googleapis.com/auth/analytics.readonly
BigQuery API View and manage your data in Google BigQuery https://developers.google.com/bigquery/docs/overview https://www.googleapis.com/auth/bigquery
BigQuery API Manage your data in Google Cloud Storage https://developers.google.com/bigquery/docs/overview https://www.googleapis.com/auth/devstorage.read_write
BigQuery API Manage your data and permissions in Google Cloud Storage https://developers.google.com/bigquery/docs/overview https://www.googleapis.com/auth/devstorage.full_control
BigQuery API View your data in Google Cloud Storage https://developers.google.com/bigquery/docs/overview https://www.googleapis.com/auth/devstorage.read_only
Blogger API Manage your Blogger account https://developers.google.com/blogger/docs/3.0/getting_started https://www.googleapis.com/auth/blogger
Blogger API View your Blogger account https://developers.google.com/blogger/docs/3.0/getting_started https://www.googleapis.com/auth/blogger.readonly
Books API Manage your books https://developers.google.com/books/docs/v1/getting_started https://www.googleapis.com/auth/books
Calendar API Manage your calendars https://developers.google.com/google-apps/calendar/firstapp https://www.googleapis.com/auth/calendar
Calendar API View your calendars https://developers.google.com/google-apps/calendar/firstapp https://www.googleapis.com/auth/calendar.readonly
Compute Engine API View and manage your Google Compute Engine resources https://developers.google.com/compute/docs/reference/v1beta13 https://www.googleapis.com/auth/compute
Compute Engine API View your Google Compute Engine resources https://developers.google.com/compute/docs/reference/v1beta13 https://www.googleapis.com/auth/compute.readonly
Compute Engine API View your data in Google Cloud Storage https://developers.google.com/compute/docs/reference/v1beta13 https://www.googleapis.com/auth/devstorage.read_only
Google Maps Coordinate API View your Google Coordinate jobs https://developers.google.com/coordinate/ https://www.googleapis.com/auth/coordinate.readonly
Google Maps Coordinate API View and manage your Google Maps Coordinate jobs https://developers.google.com/coordinate/ https://www.googleapis.com/auth/coordinate
DFA Reporting API View and manage DoubleClick for Advertisers reports https://developers.google.com/doubleclick-advertisers/reporting/ https://www.googleapis.com/auth/dfareporting
Drive API View the files and documents in your Google Drive https://developers.google.com/drive/ https://www.googleapis.com/auth/drive.readonly
Drive API View your Google Drive apps https://developers.google.com/drive/ https://www.googleapis.com/auth/drive.apps.readonly
Drive API View and manage the files and documents in your Google Drive https://developers.google.com/drive/ https://www.googleapis.com/auth/drive
Drive API View meta data for files and documents in your Google Drive https://developers.google.com/drive/ https://www.googleapis.com/auth/drive.metadata.readonly
Drive API View and manage Google Drive files that you have opened or created with this app https://developers.google.com/drive/ https://www.googleapis.com/auth/drive.file
Freebase API Sign in to Freebase with your account http://wiki.freebase.com/wiki/API https://www.googleapis.com/auth/freebase
Fusion Tables API View your Fusion Tables https://developers.google.com/fusiontables https://www.googleapis.com/auth/fusiontables.readonly
Fusion Tables API Manage your Fusion Tables https://developers.google.com/fusiontables https://www.googleapis.com/auth/fusiontables
Google Affiliate Network API View your GAN data https://developers.google.com/affiliate-network/ https://www.googleapis.com/auth/gan.readonly
Google Affiliate Network API Manage your GAN data https://developers.google.com/affiliate-network/ https://www.googleapis.com/auth/gan
Groups Settings API View and manage the settings of a Google Apps Group https://developers.google.com/google-apps/groups-settings/get_started https://www.googleapis.com/auth/apps.groups.settings
Google Latitude API Manage your city-level location https://developers.google.com/latitude/v1/using https://www.googleapis.com/auth/latitude.current.city
Google Latitude API Manage your best-available location and location history https://developers.google.com/latitude/v1/using https://www.googleapis.com/auth/latitude.all.best
Google Latitude API Manage your best-available location https://developers.google.com/latitude/v1/using https://www.googleapis.com/auth/latitude.current.best
Google Latitude API Manage your city-level location and location history https://developers.google.com/latitude/v1/using https://www.googleapis.com/auth/latitude.all.city
Moderator API Manage your activity in Google Moderator http://code.google.com/apis/moderator/v1/using_rest.html https://www.googleapis.com/auth/moderator
Google OAuth2 API View basic information about your account https://developers.google.com/accounts/docs/OAuth2 https://www.googleapis.com/auth/userinfo.profile
Google OAuth2 API View your email address https://developers.google.com/accounts/docs/OAuth2 https://www.googleapis.com/auth/userinfo.email
Google OAuth2 API Know who you are on Google https://developers.google.com/accounts/docs/OAuth2 https://www.googleapis.com/auth/plus.me
Orkut API Manage your Orkut activity http://code.google.com/apis/orkut/v2/reference.html https://www.googleapis.com/auth/orkut
Orkut API View your Orkut data http://code.google.com/apis/orkut/v2/reference.html https://www.googleapis.com/auth/orkut.readonly
Google+ API Know who you are on Google https://developers.google.com/+/api/ https://www.googleapis.com/auth/plus.me
Prediction API Manage your data in the Google Prediction API https://developers.google.com/prediction/docs/developer-guide https://www.googleapis.com/auth/prediction
Prediction API View your data in Google Cloud Storage https://developers.google.com/prediction/docs/developer-guide https://www.googleapis.com/auth/devstorage.read_only
Search API For Shopping View your product data https://developers.google.com/shopping-search/v1/getting_started https://www.googleapis.com/auth/shoppingapi
Google Site Verification API Manage your new site verifications with Google http://code.google.com/apis/siteverification/ https://www.googleapis.com/auth/siteverification.verify_only
Google Site Verification API Manage the list of sites and domains you control http://code.google.com/apis/siteverification/ https://www.googleapis.com/auth/siteverification
Cloud Storage API Manage your data in Google Cloud Storage https://developers.google.com/storage/docs/json_api/ https://www.googleapis.com/auth/devstorage.read_write
Cloud Storage API Manage your data and permissions in Google Cloud Storage https://developers.google.com/storage/docs/json_api/ https://www.googleapis.com/auth/devstorage.full_control
Cloud Storage API View your data in Google Cloud Storage https://developers.google.com/storage/docs/json_api/ https://www.googleapis.com/auth/devstorage.read_only
TaskQueue API Manage your Tasks and Task Queues http://code.google.com/appengine/docs/python/taskqueue/rest.html https://www.googleapis.com/auth/taskqueue
TaskQueue API Consume Tasks from your Task Queues http://code.google.com/appengine/docs/python/taskqueue/rest.html https://www.googleapis.com/auth/taskqueue.consumer
Tasks API Manage your tasks http://code.google.com/apis/tasks/v1/using.html https://www.googleapis.com/auth/tasks
Tasks API View your tasks http://code.google.com/apis/tasks/v1/using.html https://www.googleapis.com/auth/tasks.readonly
URL Shortener API Manage your goo.gl short URLs http://code.google.com/apis/urlshortener/v1/getting_started.html https://www.googleapis.com/auth/urlshortener
YouTube API View and manage your assets and associated content on YouTube https://developers.google.com/youtube https://www.googleapis.com/auth/youtubepartner
YouTube API Manage your YouTube videos https://developers.google.com/youtube https://www.googleapis.com/auth/youtube.upload
YouTube API Manage your YouTube account https://developers.google.com/youtube https://www.googleapis.com/auth/youtube
YouTube API View your YouTube account https://developers.google.com/youtube https://www.googleapis.com/auth/youtube.readonly
YouTube Analytics API View YouTube Analytics reports for your YouTube content http://developers.google.com/youtube/analytics/ https://www.googleapis.com/auth/yt-analytics.readonly

An overview of the various Google APIs as of December 2012. Use Google APIs Discovery Service to get an updated list.