Showing posts with label discovery service. Show all posts
Showing posts with label discovery service. Show all posts

Thursday, September 15, 2011

Three new APIs for Google Apps Script

Jacob
Gustavo
By Jacob Moshenko and Gustavo Moura, Software Engineers

In January of this year we launched BigQuery integration with Google Apps Script. What we didn’t mention was that we were building this on top of our Google APIs Discovery Service. Thanks to the ease and flexibility of writing clients based on this API, today we’re announcing integration with three more APIs, and revamping our BigQuery support.

As of now, we have also integrated the Tasks API, Prediction API, and URL Shortener API in addition to the BigQuery API. You can now include these APIs in your scripts, apps, and sites pages. As with other Apps Script services, we handle all of the server communications as well as authorization, which makes this a great way to build mashups and workflows using our APIs.

To get started, simply enable the APIs you’re interested in from the "Use Google API services" menu in the script editor.


Using this feature will prompt you to save your script. Once you have done so, the Google APIs Services dialog will appear and you can choose which APIs to use, which versions to use, and what name to use when referencing them from your scripts.


After you complete this step, the API methods will be automatically populated as you type using the standard Apps Script autocomplete mechanism. For detailed information about each API, visit our reference documentation. We have also created a tutorial with a simple, fun application to help you get started using scripts.

As we iron out this new technology and listen to your feedback we plan to aggressively integrate even more APIs. If you have any questions or experience any problems let us know on our support forum.

Jacob Moshenko is a Software Engineer working on the Google APIs developer experience. He believes that Google APIs should be easy to use, especially from Google platforms.

Gustavo Moura has been a Software Engineer at Google since 2007. He has been part of the Google Docs team since 2009. Prior to that, he worked on AdWords.

Posted by Scott Knaster, Editor

Wednesday, August 31, 2011

A new Objective-C library for a new generation of APIs

Greg
Tom
By Greg Robbins and Tom Van Lenten, Software Engineers

Four years ago, we introduced an Objective-C library for Google Data APIs. At first, it supported a scant three services - Google Base, Calendar, and Spreadsheets. Perhaps more surprising is that it was written just for Mac applications; the iPhone SDK was still a year off. In the years since, the library has grown to support 16 APIs, and has been used in many hundreds of applications. In a fine example of unforeseen consequences, most of those applications run not on the Mac but on iOS.

The Google Data APIs were built on XML and the Atom Publishing Protocol, a reasonable industry standard for the time. But mobile, low-power, and bandwidth-limited computers are now the biggest audience for client software. Across the Internet, XML and AtomPub have given way to the lighter-weight JSON data interchange format.

Other fundamental changes have also shifted the API landscape. Password-based authentication is being supplanted by the more secure and flexible OAuth 2 standard. The number of APIs has grown dramatically, making it impractical to hand-craft data classes for all APIs and all languages. When services offer API improvements, developers want access to those changes as quickly as possible.

To support this evolving world, we are introducing a brand new library for Cocoa developers, the Google APIs Client Library for Objective-C. The library supports recent Google JSON APIs, including Tasks, Latitude, Books, URL Shortener, and many others. It is designed to make efficient use of the device’s processor and memory, so it’s a great fit for iOS applications.

The new library includes high-level Objective-C interfaces and data classes for each service, generated from the Google APIs Discovery Service. This lets the library model data not just as generic JSON dictionaries, but also with first-class Objective-C 2.0 objects. The classes include properties for each field, letting developers take advantage of Xcode’s code completion and syntax and type checking.

Here’s how easy it is to use the library and the new Google Books API to search for and print the titles of free ebooks by Samuel Clemens:
#import "GTLBooks.h"

GTLServiceBooks *service = [[GTLServiceBooks alloc] init];

GTLQueryBooks *query = 
  [GTLQueryBooks queryForVolumesListWithQ:@"Mark Twain"];
query.filter = kGTLBooksFilterFreeEbooks;

[service executeQuery:query
    completionHandler:^(GTLServiceTicket *ticket,
                        id object, NSError *error) {
      // callback
      if (error == nil) {
        GTLBooksVolumes *results = object;
        for (GTLBooksVolume *volume in results) {
          NSLog(@"%@", volume.volumeInfo.title);
        }
      }
    }];
The library supports Google’s partial response and partial update protocols, so even items of data-rich APIs can be retrieved and updated with minimal network overhead. It also offers a simple, efficient batch model, so many queries can be combined into one http request and response, speeding up applications.

When we introduced the previous Objective-C library, it was with this assertion: When you trust your personal data to Google, it's still your data. You're free to edit it, to share it with others, or to download it and take it somewhere else entirely. We hope the new library and Google’s growing collection of APIs help iOS and Mac developers to keep that principle meaningful for many years to come. You can start using the Google APIs Client Library for Objective-C by checking it out from our open-source project site and by subscribing to the discussion group.

Since Google I/O 2010, we've been developing APIs that can provide descriptions of themselves via metadata. This new technique makes it easier to create and maintain client libraries that support more languages, work with more APIs, and are easier to use than ever before. This post announces one of several recent major milestones for our client libraries.


Greg Robbins writes code to connect Mac and iOS apps to Internet services. He chases dogs in the morning, and bugs in the afternoon.

Tom Van Lenten is a Software Engineer on the Google Chrome team. He is also hooked on the Google Toolbox for Mac open source projects.


Posted by Scott Knaster, Editor


Monday, May 09, 2011

Google APIs Discovery Service: one API to find them all

Anton
Monsur
Joe
By Anton Lopyrev, Monsur Hossain, and Joe Gregorio, Google Developer Team

As announced at last Google I/O, the new family of Google APIs client libraries runs on top of a brand new API infrastructure, which allows Google to reduce the amount of work needed to release and maintain the client libraries. This is done through a simple API that provides machine readable descriptions of Google APIs that the client libraries take advantage of.

Today, we are announcing the Google APIs Discovery Service, which is the secret sauce behind the new client libraries. This service exposes machine readable metadata about Google APIs including:
  • A directory of supported APIs.
  • A "Discovery document" for each of the supported APIs that includes:
    • A list of API resource schemas based on JSON Schema.
    • A list of API methods and available parameters for each method.
    • A list of available OAuth 2.0 scopes.
  • Inline documentation of methods, parameters, and available parameter values.
The service is accessible through a lightweight JSON-based API. Navigate your browser to https://www.googleapis.com/discovery/v1/apis to get a quick look at the available data.

You can use the APIs Discovery Service to build tools for interacting with Google APIs, such as IDE Plugins and client libraries. We use the service at Google to build a number of such tools:
With the launch of this service, we are also open-sourcing the code for the APIs Explorer, which can serve as a great example of how to use the service.

Read more about Google APIs Discovery Service in the documentation, or explore its API in the APIs Explorer. If you are attending this year’s Google I/O and you want to know more about the service, make sure to attend our session “Building Custom Client Libraries for Google APIs” where you can chat with the developers of the service face-to-face.

We look forward to seeing what sorts of things you can build. Let us know of any issues and feature requests in our developer forum. Happy hacking!


Anton Lopyrev is an Associate Product Manager for Google APIs Infrastructure, previously a software engineer on Street View. He is a computer graphics enthusiast who is also passionate about product design.

Joe Gregorio is a Software Engineer. In the past four years at Google he’s worked on APIs, Google App Engine, Google Wave, and now has come full circle and is back working on APIs.

Monsur Hossain is a Software Engineer for Google APIs Infrastructure and enjoys making it easier to use APIs.


Posted by Scott Knaster, Editor