Message Center info through our API

Wednesday, December 10, 2008

Recently we mentioned some updates in the Webmaster Tools GData API: we've just launched a whole new API, the Message Center GData API, as part of the Webmaster Tools API. The Message Center is the way that Google communicates to webmasters important issues regarding their sites—for example, if there's a problem crawling your site, or if someone has requested a change in crawl rate. Until now it was only possible to access these messages through the Message Center section of Webmaster Tools; but now you can also use GData to access it as a feed. This way you don't need to continually check your messages in Webmaster Tools, you can retrieve the messages feed automatically and be informed as soon as possible of any critical issues regarding your site.

What can I do?

The Message Center GData API lets you retrieve all messages, mark the messages as read or unread, and delete messages. You can do these tasks using the provided Java client libraries, or you can create your own client code based on the protocol information.

  • Retrieve messages: The messages feed contains all the messages sent to your account. These messages have important information about your verified sites. Examples of messages include infinite spaces warnings and crawl rate change notifications.
  • Mark messages as read or unread: In order to keep track of new communications from Google, you can mark your messages as read or unread, the same way that you would manage your inbox. If you retrieve a single message, this message will be automatically marked as read.
  • Delete messages: It's possible to delete messages using the GData API. However, be careful because if you delete a message through the API it will also be deleted in your Webmaster Tools account, as both interfaces share the same data.

How do I do it?

You can download code samples in Java for all these new features. These samples provide simple ways to use the messages feed. The following snippet shows how to retrieve the messages feed in a supported language and print all the messages:

// Connect with the service and authenticate
WebmasterToolsService service
    = new WebmasterToolsService("exampleCo-exampleApp-1");
try {