Sunday 26 January 2014

How To use Blogger API v3 to use Blogger content in Client Applications?

www.hackserialkey.com
www.hackserialkey.com

Are you a developer who likes to blog? You can use the Google Blogger API to create amazing Blogger client applications of your own! The Blogger API v3 allows external applications to view and update Blogger content. Your client application can use Blogger API v3 to create new blog posts, edit or delete existing posts, and query for posts that match particular criteria. You can use this API to create desktop and browser apps and create a whole new user-base of your own.



What is the Blogger API and what can you do with it?

An API, or Application Package Interface is a set of commands you can call, or interface with, from an external application. The developers of an application provides APIs if they want other developer to create apps and interact with their own.

Similarly, the Blogger team has created an API of its own that allows external developers to interact with the Blogger content management system. With this API, you can;
  • Add posts, pages and comments from your Blogger blog to a non-blogger website
  • Create desktop software that allows users to create or edit Blogger posts from their desktop computers
  • Create browser and mobile-based apps that serve the same purpose as above

Basics

First, you need to know some of the basics of objects and resources available in the API. There are five types of resources currently available.
  • Blogs - A blog resource represents a full Blogger blog. A user may have more than one Blogger blogs, so the control of multiple blogs is handled by the blogs resource. You can use it to list all the blogs a user has access to, or get a single blog by its ID.
  • Posts - A post resource represents a post on a blog, and each is a child of the blog resource. A posts collection contains all the post resources within a blog resource.
  • Comments - A comment resource represents a comment on a blog post, and is logically a child object of the respective post resource. A comments collection is a list of all comments under a posts (parent) resource.
  • Pages - A blog has static pages which inherit from the blog (as child objects).
  • Users - A user resource represents a non-anonymous user, and is used to identify the author of a blog post, page, or comment. A users collection is a list of all the (global) user resources on Blogger. For privacy reasons, a list of all the users on Blogger cannot be listed. However, you can retrieve your own user resource by your unique ID (or by using the self identifier)
Blogger resource hierarchy

API Reference

Here is a list of methods as described in the Blogger API v3 reference.

OperationDescriptionREST HTTP mappings
listLists all resources within a collectionGET on a collection URI
getGets a specific resourceGET on a resource URI
getByUrlGets a resource, looking it up by URLGET with the URL passed in as a parameter
getByPathGets a resource by looking it up by its pathGET with the Path passed in as a parameter
listByUserLists resources owned by a UserGET on a user owned collection
searchSearch for resources, based on a query parameterGET on a Search URL, with the query passed in as a parameter
insertCreate a resource in a collectionPOST on a collection URI
deleteDeletes a resourceDELETE on a resource URI
patchUpdate a resource, using Patch semanticsPATCH on a resource URI
updateUpdate a resourcePUT on a resource URI

The following table matches the resource types in the API (which we discussed earlier) with the methods they support.

Resource TypeSupported Methods
listgetgetByUrlgetByPathlistByUsersearchinsertdeletepatchupdate
Blogs
Posts
Comments
Pages
Users

You can use these methods to develop a fully functional Blogger app. There are various ways of invoking these methods. You can use HTTP client-side commands, or from JavaScript. You can also develop using client libraries on any one of the following platforms.

  • .NET
  • Java
  • PHP
  • Python
  • Ruby
  • Go
  • GWT
  • JavaScript
  • Node.js
  • Objective-C

We will talk more about these client libraries, and calling methods in a future post. In the meantime, if you have any questions regarding the functionality of this API or its methods, please feel free to ask in the comments section below. Cheers :)
:::::::::::::::::::::::::::::By:-SJSM -THE HARYANVI

0 comments:

Post a Comment