This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Blogger API v3 Connector

The Blogger API v3 connector allows you to connect to Google Blogger, a free weblog publishing tool from Google, for sharing text, photos and video. The connector uses the Blogger API v3 to connect to Google Blogger to retrieve information and manipulate Blogs, Posts and Comments. It uses the RESTfull API calling style to invoke the methods exposed by the Blogger API.

The following sections describe how to perform various operations with the connector. For general information on using connectors and their operations in your ESB configurations, see Using a Connector.

Additional information

For general information on using connectors and their operations in your ESB configurations, see Using a Connector. To download the connector, go to https://store.wso2.com/store/assets/esbconnector/details/blogger, and click Download Connector. Then you can add and enable the connector in your ESB instance.

Connecting to Blogger

To use the Blogger API connector, add the <blogger.init> element in your configuration before any other Blogger method invocation. This methods initialises the connector and takes two parameters,

  1. <apiKey> parameter, which is a mandatory parameter that accepts the API key provided by Google Blogger , that can be obtained from the Google API console.

  2. <accessToken> parameter, an optional parameter needed when calling operations in Blogger API needing authentication and when invoking any method for private blog.Blogger API uses Oauth 2.0 as authentication method this parameter is the access token that can be obtained from the Google Oauth Playground

init
 <blogger.init>
            <apiKey>AIzaSyC-fVD7wQtYqwN4owNxLINjHBQGDZ</apiKey>
            <accessToken>ya29.1.AADtN_XyJg7h9DI0LJLpR53F7iaClmfcixih9JdRSZ4_upgeINUy05aRXWhMUzAHS</accessToken>
 </blogger.init>

For all method in the following sections, only the <apiKey> would be required, unless stated otherwise.

Entering secure data

For security purposes, you should store your accessToken and API key in the WSO2 secure vault and reference it by alias instead of hard-coding the actual values in the configuration file. For more information, see Working with Passwords.

 


Working with Blogs

The following operations are available for working with Blog Resources:

OperationDescription
getBlogReturn information of specific blog identified by its blog id, as blog resource.
getByURLReturn information of specific blog identified by its URL, as blog resource.
listByUserReturn a list of blogs by a user specified by a user id.

Following is more information about these operations.

Get blog information by ID

getBlog
<blogger.getBlog>
            <blogID>19072347933726</blogID>
</blogger.getBlog>

Oauth authentication is needed if the Blog is a Private blog. Therefore the <a when performing this operation on private blog ccessToken> parameter should be set at initialization of connector.

Properties
  • blogID: The ID of the blog to get.

    optional
  • maxPosts: Maximum number of posts to retrieve along with the blog. When this tag is not specified, no posts will be returned as part of the blog resource.
  • fields: List of fields of the blog that should be returned. Refer to   Specifying Fields
Return Object

Returns a blog resource matching the blog ID provided.

 

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/blogs/get

 

Get blog information by URL

getBlog
<blogger.getByURL>
            <url>http://example.blogspot.com</url>
</blogger.getByURL>

Oauth authentication is needed if the Blog is a Private blog. Therefore when performing this operation on private blog the <accessToken> parameter should be set at initialization of connector.

Properties
  • blogID: The ID of the blog to get.

  • optional
  • fields: List of fields of the blog that should be returned. Refer to   Specifying Fields

Return Object

Returns a blog resource matching the url provided.

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/blogs/getByUrl

 

List Blogs by User

getBlog
<blogger.listByUser>
            <userID>453344533<userID>
</blogger.listByUser>

Oauth authentication is mandatory. Therefore the <accessToken> parameter should be set at initialization of connector.

Properties
  • userID: The ID of the user whose blogs are to be fetched. Either the word self or the user's profile ID.

    optional
  • fetchUserInfo: Whether the response is a list of blogs with per-user information instead of just blogs. Accept 'true' or 'false'.
  • view:  Level of details. Acceptable values are:
              "ADMIN": Admin level detail
              "AUTHOR": Author level detail
              "READER": Admin level detail
  • fields: List of fields of the blog that should be returned. Refer to   Specifying Fields
     

Return Object

Returns a list of blog resources by the user with user ID.

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/blogs/listByUser

 


Working with Posts

The following operations are available for working with Post Resources:

OperationDescription
listPostsReturns a List of posts of a specific blog
getPostReturn a specific post of a specific blog
searchPost

Search for a post matching a specific keyword

insertPost

Insert a new post to a specific blog

deletePostDelete a specific post in a specific blog
getPostByPathReturn a specific post of a specific blog, by posts path
patchPostApply a patch to an existing post in a specific blog
updatePostUpdate a specific post of a specific blog
publishPostPublish a specific draft state post of specific blog
revertPostRevert a specific post of a specific blog to its draft state

Following is more information about these operations.

 

List Posts In Blog 

getBlog
<blogger.listPosts>
            <blogID>19072347933726</blogID>
</blogger.listPosts>

Oauth authentication is needed if the Blog is a Private blog. Therefore when performing this operation on private blog the <accessToken> parameter should be set at initialization of connector.

Properties

 

  • blogID: The ID of the blog to get.

    optional
  • endDate :       Latest post date to fetch, a date-time with format .
  • fetchBodies:   A boolean value of 'true' or 'false'. Whether the body content of posts is included.
  • fetchImages:  A boolean value of 'true' or 'false'. Whether image URL metadata for each post is included.
  • labels:           Comma-separated list of labels to search for.
  • maxResults:  A number representing the maximum number of posts to fetch.
  • orderBy:        Sort order applied to results. Acceptable values are:

                        "published": Order by the date the post was published

                        "updated": Order by the date the post was last updated

  • pageToken:    Continuation token if the request is paged.

  • startDate:      Earliest post date to fetch, a date-time with format YYYY-MM-DD

  • status:          Acceptable values are:

                        "draft": Draft posts

                        "live": Published posts

                        "scheduled": Posts that are scheduled to publish in future.

  • view:           Acceptable values are:

                         "ADMIN": Admin level detail

                         "AUTHOR": Author level detail

                         "READER": Reader level detail   

 

Return Object

Returns a list of post resources.

 

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/posts/list

 

Get a specific Post of Blog 

getBlog
<blogger.searchPost>
            <blogID>453344533<postID>
            <postID>1234233444</postID>
</blogger.searchPost>

Oauth authentication is needed if the Blog is a Private blog. Therefore  when performing this operation on private blog the <accessToken> parameter should be set at initialization of connector.

Properties
  • blogID: The ID of the blog to return the post from. 

  • postID: The ID of the post.

    optional
  • maxComments: A number representing the maximum number of comments to return with the post. If not specified, defaults to 0
  • view:               Level of details. Acceptable values are:
                            "ADMIN": Admin level detail
                            "AUTHOR": Author level detail
                            "READER": Admin level detail
  • fields:    List of fields of the blog that should be returned. Refer to   Specifying Fields

Return Object

Returns a post resource matching post ID provided.

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/posts/get

 

Search a Post with a specific keyword 

getBlog
<blogger.searchPost>
            <blogID>453344533<blogID>
            <query>NUMERIC</query>
</blogger.searchPost>

Oauth authentication is needed if the Blog is a Private blog. Therefore when performing this operation on private blog the <accessToken> parameter should be set at initialization of connector.

Properties
  • blogID: The ID of the blog in which the search is performed

  • query:   Keyword to query in post.

    optional
  • fetchBodies:   A boolean value of 'true' or 'false'. Whether the body content of posts is included.
  • orderBy:        Sort order applied to results. Acceptable values are:

                        "published": Order by the date the post was published

                        "updated": Order by the date the post was last updated
  • fields:    List of fields of the blog that should be returned. Refer to   Specifying Fields


Return Object

Returns a post resource matching the query term.

 

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/posts/search

 

 

Add a new Post to a specific Blog 

getBlog
<blogger.insertPost>
            <blogID>453344533<blogID>
            <isDraft>false</isDraft>
     <title>New Post</title>
     <content>This is a new post</content>
</blogger.insertPost>

Oauth authentication is mandatory. Therefore the <accessToken> parameter should be set at initialization of connector.

Properties
  • blogID: The ID of the blog to which the post is posted.

    optional
  • isDraft:             Boolean value accepting 'true' or 'false'. Specify whether new post is in draft state or published state

  • title:                 Title of the post

  • content:             The content text of the post
  • authorName:    Name of author displayed

  • authorURL:         The URL of the post creator's profile page

  • authorImgURL:   The post creator's avatar URL

  • locationName:   Location name

  • locationLat:     Location's latitude. Entered as double value

  • locationLng:     Location's longitude. Entered as double value

  • locationSpan:   Location's viewport span. Used when rendering a map preview.

  • titleLink:         The title link URL

  • labels:               Comma separated list of labels this post was tagged with

  • images:               Comma separated list of URLs of display images for the Post

  • published:            Date and Time of post publish is scheduled in datetime format
  • update:                    Date and Time of post update is scheduled in datetime format
  • fields:       List of fields of the blog that should be returned. Refer to   Specifying Fields
     

Return Object

Returns a post resource representing the post that was newly created.

 

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/posts/insert

 

Delete a specific Post

getBlog
<blogger.deletePost>
            <blogID>453344533<blogID>
            <postID>21333444231</postID>
</blogger.deletePost>

Oauth authentication is mandatory. Therefore the <accessToken> parameter should be set at initialization of connector.

Properties
  • blogID: The ID of the blog in which the post is in

  • postID: The post ID of the post to be deleted

Return Object

No Object returned.

 

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/posts/delete

 

Get a Post by its path 

getBlog
<blogger.getPostByPath>
            <blogID>453344533<blogID>
            <path>/2011/09/blogger-json-api-now-available.html</path>
</blogger.getPostByPath>

Oauth authentication is needed if the Blog is a Private blog. Therefore when performing this operation on private blog the <accessToken> parameter should be set at initialization of connector.

Properties
  • blogID: The ID of the blog to which the post is posted.

  • path:       Path of the Post to retrieve 
     

    optional

  • maxComments: A number representing the maximum number of comments to return with the post. If not specified, defaults to 0

  • view:               Level of details. Acceptable values are:

                        "ADMIN": Admin level detail
                        "AUTHOR": Author level detail
                        "READER": Admin level detail

  • fields:    List of fields of the blog that should be returned. Refer to   Specifying Fields

Return Object

Returns a post resource representing the post given by path

 

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/posts/getByPath

 

 

Apply a patch to an existing Post of a specific Blog 

getBlog
<blogger.patchPost>
            <blogID>453344533<blogID>
            <postID>12442334589</postID>
     <title>New Title of Post</title>
     <content>Added content new post</content>
</blogger.patchPost>

Oauth authentication is mandatory. Therefore the <accessToken> parameter should be set at initialization of connector.

Properties
  • blogID: The ID of the blog in which the patched post resides.

  • postID: The ID of the patched post.

    optional
  • title:                   Title of the post

  • content:              The content text of the post
  • authorName:       Name of author displayed

  • authorURL:         The URL of the post creator's profile page

  • authorImgURL:   The post creator's avatar URL

  • locationName:   Location name

  • locationLat:     Location's latitude. Entered as double value

  • locationLng:     Location's longitude. Entered as double value

  • locationSpan:   Location's viewport span. Used when rendering a map preview.

  • titleLink:         The title link URL

  • labels:                Comma separated list of labels this post was tagged with

  • images:                Comma separated list of URLs of display images for the Post.

  • published:            Date and Time of post publish is scheduled in datetime format
  • update:                    Date and Time of post update is scheduled in datetime format
  • fields:      List of fields of the blog that should be returned. Refer to   Specifying Fields
     

Return Object

Returns a post resource representing the post that was patched.

 

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/posts/patch

 

Update an existing Post of a specific Blog 

getBlog
<blogger.updatePost>
            <blogID>453344533<blogID>
            <postID>12442334589</postID>
     <title>Updated Title of Post</title>
     <content>Updated content new post</content>
</blogger.updatePost>

Oauth authentication is mandatory. Therefore the <accessToken> parameter should be set at initialization of connector.

Properties
  • blogID: The ID of the blog in which the updated post resides.

  • postID: The ID of the post that should be updated.

    optional
  • title:                   Title of the post

  • content:              The content text of the post
  • authorName:       Name of author displayed

  • authorURL:         The URL of the post creator's profile page

  • authorImgURL:   The post creator's avatar URL

  • locationName:   Location name

  • locationLat:     Location's latitude. Entered as double value

  • locationLng:     Location's longitude. Entered as double value

  • locationSpan:   Location's viewport span. Used when rendering a map preview.

  • titleLink:         The title link URL

  • labels:                Comma separated list of labels this post was tagged with

  • images:                Comma separated list of URLs of display images for the Post.

  • published:            Date and Time of post publish is scheduled in datetime format
  • update:                    Date and Time of post update is scheduled in datetime format
  • fields:      List of fields of the blog that should be returned. Refer to   Specifying Fields
     

Return Object

Returns a post resource representing the post that was published.

 

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/posts/update

 

Publish an existing Post in draft state 

getBlog
<blogger.publishPost>
            <blogID>453344533<blogID>
            <postID>12442334589</postID>
</blogger.publishPost>

Oauth authentication is mandatory. Therefore the <accessToken> parameter should be set at initialization of connector.

Properties
  • blogID: The ID of the blog in which the updated post resides.

  • postID: The ID of the post that should be updated.

    optional
  • publishDate:    Date and Time of post publish is scheduled in datetime format
  • fields:     List of fields of the blog that should be returned. Refer to   Specifying Fields
     

Return Object

Returns a post resource representing the post that was updated.

 

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/posts/publish

 

Revert an existing Post to draft state 

getBlog
<blogger.revertPost>
            <blogID>453344533<blogID>
            <postID>12442334589</postID>
</blogger.revertPost>

Oauth authentication is mandatory. Therefore the <accessToken> parameter should be set at initialization of connector.

Properties
  • blogID: The ID of the blog in which the updated post resides.

  • postID: The ID of the post that should be updated.

    optional
  • fields:     List of fields