The Google Picker API

 

Users have content across many Google properties: YouTube, Picasa Web Albums, Google Docs, and more. Now we have a common interface for your users to select Google content. The Google Picker API provides a familiar-looking dialog box that’s easy for you to integrate into your apps. Your users can quickly browse their own content without ever leaving your page or app.

Perhaps you’re developing a blogging platform and you want your users to be able to embed their Picasa Web Albums photos. You can even let your users pick from public content, as found from image and video search.

Once the Picker is invoked by your user, a modal dialog appears on the page. If the user is already signed in to their Google account, they’ll see their content in just a second or two. If not, the user will be asked to sign in.

Integrating with the Google Picker API is straightforward. First, you specify which Google services should show up as options in the Picker navigation. For example, if you’re a photo site, you may choose to show Picasa and Google Image Search, but hide Google Docs and other services. Then, you simply specify a callback function that will be called as soon as the user’s data is returned to your application.

var picker = new google.picker.PickerBuilder().
    addView(google.picker.ViewId.IMAGE_SEARCH).
    setCallback(pickerCallback).
    build();
picker.setVisible(true);

You can find more integration details and examples in the documentation. We hope you enjoy this new API!

Richer photo support in the Google Buzz API

You’ve already been able to simply include a photo in a Google Buzz post using the Buzz API. Today we’re making it much easier to add photos to Buzz posts. Additionally, using Picasa as the photo repository, you’ll now be able to wield the Buzz API to take all sorts of other actions on behalf of the user:

  • Create a new album
  • Get an album
  • Update an album’s metadata
  • Delete an album
  • List a user’s albums
  • Upload a new photo
  • Get a photo
  • Update a photo’s metadata
  • Delete a photo
  • List a user’s photos

Accessing a photo entry through the Buzz API is just as easy as getting an activity. The form for retrieving an activity is:

https://www.googleapis.com/buzz/v1/activities/{userId}/@self/{activityId}

With just a few alterations, we get the form for retrieving a photo:

https://www.googleapis.com/buzz/v1/photos/{userId}/@self/{albumId}/@photos/{photoId}

With live data, it would look like the following URL:

https://www.googleapis.com/buzz/v1/photos/farago/@self/5251364904403459921/@photos/5251366163678993586?alt=json&prettyprint=true

Browse to that address and you’ll get data that will point to this Picasa photo:

(Photo by Julie Farago, used under the Creative Commons Attribution Non-Commercial Share-Alike license)

The read-only endpoints will return public data without authentication. For authenticated access to the photos endpoints, you must be granted an OAuth token for the user with both the Buzz and Photos API scopes. For existing users, you will need to discard the OAuth tokens scoped to the Buzz API and request authorization to both scopes. More details can be found on the Google Buzz API documentation site.

Photos are an essential part of social applications. We expect these new capabilities will allow you to enrich your user’s experience with a minimum of fuss. As always, please swing by the Developer Forum to let us know what you think. And if you haven’t already, start using the APIs console to track your API usage and other coolness.