Stay organized with collectionsSave and categorize content based on your preferences.
Wednesday, December 10, 2008
Recently wementionedsome updates in theWebmaster Tools GData API:
we've just launched a whole new API, theMessage CenterGData
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 aproblem crawling your site,
or if someone has requested achange 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 useGDatato 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 providedJava client libraries,
or you can create your own client code based on theprotocol 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
includeinfinite spaces warningsandcrawl rate changenotifications.
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 downloadcode samples in Javafor 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 asupported languageand
print all the messages:
// Connect with the service and authenticate
WebmasterToolsService service
= new WebmasterToolsService("exampleCo-exampleApp-1");
try {
service.setUserCredentials(USERNAME, PASSWORD);
} catch (AuthenticationException e) {
System.out.println("Username or password invalid");
return;
}
// Retrieve messages feed
MessagesFeed messages;
try {
URL feedUrl;
if (USER_LANGUAGE == null) {
feedUrl = new URL(MESSAGES_FEED_URI);
} else {
feedUrl = new URL(MESSAGES_FEED_URI
+ "?hl=" + USER_LANGUAGE);
}
messages = service.getFeed(feedUrl, MessagesFeed.class);
} catch (IOException e) {
System.out.println("There was a network error.");
return;
} catch (ServiceException e) {
System.out.println("The service is not available.");
return;
}
// Print the messages feed
System.out.println(messages.getTitle().getPlainText());
for (MessageEntry entry : messages.getEntries()) {
if (entry.getRead()) {
System.out.print(" \t");
} else {
System.out.print("new\t");
}
System.out.print(entry.getDate().toUiString() + "\t");
System.out.println(entry.getSubject());
}
Where do I get it?
If you want to know more about GData, you may want to start by checking out theGData website. The home page of theWebmaster Tools GData APIcontains a section on the messages feed, with details about the protocol. You can also download
the sample Message Center client form theGData download site.
It will show you how to use all the Message Center GData API features.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],[],[[["\u003cp\u003eGoogle launched the Message Center GData API, allowing programmatic access to Webmaster Tools messages regarding site issues.\u003c/p\u003e\n"],["\u003cp\u003eThe API enables retrieving, marking as read/unread, and deleting messages, eliminating the need to constantly check Webmaster Tools.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize Java client libraries or build their own clients based on the provided protocol information for integration.\u003c/p\u003e\n"],["\u003cp\u003eMessages include crucial information like crawl errors, security issues, and crawl rate change requests, ensuring prompt awareness.\u003c/p\u003e\n"],["\u003cp\u003eAccessing the API involves authenticating with Google credentials and utilizing provided code samples or creating custom clients.\u003c/p\u003e\n"]]],["The Webmaster Tools Message Center GData API launched, allowing users to access site-related communications from Google via a feed. Key actions include retrieving messages, marking them as read or unread, and deleting them. Messages contain crucial information, like crawl errors or rate change requests. Users can utilize Java client libraries or create custom code to manage these messages, with Java code samples provided for implementation. This enables automatic monitoring of critical site issues.\n"],null,["# Message Center info through our API\n\nWednesday, December 10, 2008\n\n\nRecently we [mentioned](/search/blog/2008/10/webmaster-tools-api-updated-with-site)\nsome updates in the\n[Webmaster Tools GData API](https://code.google.com/apis/webmastertools/):\nwe've just launched a whole new API, the\n[Message Center](/search/blog/2007/07/message-center-let-us-communicate-with) GData\nAPI, as part of the Webmaster Tools API. The Message Center is the way that Google communicates to\nwebmasters important issues regarding their sites---for example, if there's a\n[problem crawling your site](https://www.google.com/support/webmasters/bin/answer.py?answer=76401),\nor if someone has requested a\n[change in crawl rate](https://www.google.com/support/webmasters/bin/answer.py?answer=48620).\nUntil now it was only possible to access these messages through the Message Center section of\nWebmaster Tools; but now you can also use\n[GData](https://code.google.com/apis/gdata/)\nto access it as a feed. This way you don't need to continually check your messages in Webmaster\nTools, you can retrieve the messages feed automatically and be informed as soon as possible of\nany critical issues regarding your site.\n\nWhat can I do?\n--------------\n\n\nThe Message Center GData API lets you retrieve all messages, mark the messages as read or unread,\nand delete messages. You can do these tasks using the provided\n[Java client libraries](https://code.google.com/p/gdata-java-client/),\nor you can create your own client code based on the\n[protocol information](https://code.google.com/apis/webmastertools/docs/developers_guide).\n\n- **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](/search/blog/2008/08/to-infinity-and-beyond-no) and [crawl rate change](https://www.google.com/support/webmasters/bin/answer.py?answer=48620&topic=10082) notifications.\n- **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.\n- **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.\n\nHow do I do it?\n---------------\n\n\nYou can download\n[code samples in Java](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/webmastertools/)\nfor all these new features. These samples provide simple ways to use the messages feed. The\nfollowing snippet shows how to retrieve the messages feed in a\n[supported language](/search/blog/2008/05/webmaster-tools-now-in-26-languages) and\nprint all the messages: \n\n```\n// Connect with the service and authenticate\nWebmasterToolsService service\n = new WebmasterToolsService(\"exampleCo-exampleApp-1\");\ntry {\n service.setUserCredentials(USERNAME, PASSWORD);\n} catch (AuthenticationException e) {\n System.out.println(\"Username or password invalid\");\n return;\n}\n// Retrieve messages feed\nMessagesFeed messages;\ntry {\n URL feedUrl;\n if (USER_LANGUAGE == null) {\n feedUrl = new URL(MESSAGES_FEED_URI);\n } else {\n feedUrl = new URL(MESSAGES_FEED_URI\n + \"?hl=\" + USER_LANGUAGE);\n }\n messages = service.getFeed(feedUrl, MessagesFeed.class);\n} catch (IOException e) {\n System.out.println(\"There was a network error.\");\n return;\n} catch (ServiceException e) {\n System.out.println(\"The service is not available.\");\n return;\n}\n// Print the messages feed\nSystem.out.println(messages.getTitle().getPlainText());\nfor (MessageEntry entry : messages.getEntries()) {\n if (entry.getRead()) {\n System.out.print(\" \\t\");\n } else {\n System.out.print(\"new\\t\");\n }\n System.out.print(entry.getDate().toUiString() + \"\\t\");\n System.out.println(entry.getSubject());\n}\n```\n\nWhere do I get it?\n------------------\n\n\nIf you want to know more about GData, you may want to start by checking out the\n[GData website](https://code.google.com/apis/gdata/). The home page of the\n[Webmaster Tools GData API](https://code.google.com/apis/webmastertools/)\ncontains a section on the messages feed, with details about the protocol. You can also download\nthe sample Message Center client form the\n[GData download site](https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/webmastertools/).\nIt will show you how to use all the Message Center GData API features.\n\nWritten by Javier Tordable, Software Engineer"]]