All docs This doc
Skip to end of metadata
Go to start of metadata

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 of the blog that should be returned. Refer to   Specifying Fields
     

Return Object

Returns a post resource representing the post that was reverted.

 

Related Blogger API documentation

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

 

 


Working with Comments

The following operations are available for working with Comment Resources:

OperationDescription
listCommentsReturns a List of comments of a posts in a specific blog
getCommentReturn a specific comment of post in a specific blog
listCommentsByBlog

Returns a list comments of a specific blog

approveComment

Approve a specific comment , as not spam

deleteCommentDelete a specific comment
markCommentAsSpamMarks a comment as spam
removeCommentContentPublish a specific draft state post of specific blog

Following is more information about these operations.

 

 

List comments of a specific Posts in a Blog 

This method returns a list of comments with there content and meta-data as required.

<blogger.listComments>
            <blogID>453344533<blogID>
            <postID>12442334589</postID>
</blogger.listComments>

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 post reside

  • postID: The ID of the post the comments be returned

             optional

  • endDate:          Latest date of comment to fetch, in date-time formatting
  • fetchBodies  Whether the body content of the comments is included.
  • maxResults:    A number representing the maximum number of comments to include in the result.
  • pageToken:      Continuation token if request is paged.
  • startDate:      Earliest date of comment to fetch, in date-time formatting.
  • status:              Acceptable values are:
        "emptied": Comments that have had their content removed
        "live":         Comments that are publicly visible
        "pending": Comments that are awaiting administrator approval
        "spam":      Comments marked as spam by the administrator
  • view:               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 comment resource.

 

Related Blogger API documentation

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

 

Get a specific Comment of Post in a Blog

getComment
<blogger.getComment>
            <blogID>453344533<postID>
            <postID>1234233444</postID>
            <commentID>34543234545</commentID>
 </blogger.getComment>

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 where post resides. 

  • postID:           The ID of the post where comment resides.

  • commentID:    The ID of comment that should be returned

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

Return Object

Returns a comment resource matching comment ID provided.

Related Blogger API documentation

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

 

List comments of an entire Blog 

This method returns a list of comments across all posts of the entire blog

<blogger.listCommentsByBlog>
            <blogID>453344533<blogID>
</blogger.listCommentsByBlog>

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.

             optional

  • endDate:          Latest date of comment to fetch, in date-time formatting
  • fetchBodies  Whether the body content of the comments is included.
  • maxResults:    A number representing the maximum number of comments to include in the result
  • pageToken:      Continuation token if request is paged.
  • startDate:      Earliest date of comment to fetch, in date-time formatting
  • fields:     List of fields of the blog that should be returned. Refer to   Specifying Fields
     

Return Object

Returns a list of comment resources.

 

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/comments/listByBlog

 

Approve a Comment of Post in a Blog

This methods marks a specific comment of a post as not spam and returns the comment and its meta-data.

getComment
<blogger.approveComment>
            <blogID>453344533<postID>
            <postID>1234233444</postID>
            <commentID>34543234545</commentID>
 </blogger.approveComment>

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

Properties
  • blogID:           The ID of the blog where post resides. 

  • postID:           The ID of the post where comment resides.

  • commentID:    The ID of comment that should be approved

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

Return Object

Returns a comment resource matching comment ID provided.

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/comments/approve

 

 

Delete a Comment of Post in a Blog

This methods deletes a specific comment of a post.

deleteComment
<blogger.deleteComment>
            <blogID>453344533<postID>
            <postID>1234233444</postID>
            <commentID>34543234545</commentID>
 </blogger.deleteComment>

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

Properties
  • blogID:           The ID of the blog where post resides. 

  • postID:           The ID of the post where comment resides.

  • commentID:    The ID of comment that should be deleted

Return Object

Returns an empty object.

Related Blogger API documentation

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

 

Mark as spam a Comment of Post in a Blog

This methods marks removes the contents of a specific comment and returns the comment and its meta data.

markCommentAsSpam
<blogger.markCommentAsSpam>
            <blogID>453344533<postID>
            <postID>1234233444</postID>
            <commentID>34543234545</commentID>
 </blogger.markCommentAsSpam>

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

Properties
  • blogID:           The ID of the blog where post resides

  • postID:           The ID of the post where comment resides

  • commentID:    The ID of comment of which the contents are removed

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

Return Object

Returns a comment resource matching comment ID provided.

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/comments/markAsSpam

 

Remove contents of a Comment of Post in a Blog

This methods marks a specific comment of a post as spam and returns the comment and its meta-data.

markCommentAsSpam
<blogger.removeCommentContent>
            <blogID>453344533<postID>
            <postID>1234233444</postID>
            <commentID>34543234545</commentID>
 </blogger.removeCommentContent>

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

Properties
  • blogID:           The ID of the blog where post resides. 

  • postID:           The ID of the post where comment resides.

  • commentID:    The ID of comment that should be marked as spam

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

Return Object

Returns a comment resource matching comment ID provided.

Related Blogger API documentation

https://developers.google.com/blogger/docs/3.0/reference/comments/removeContent

 

 


Working with Users

The following operations are available for working with User Resource:

OperationDescription
getUserReturns user information of specific user

Following is more information about these operations.

 

Get user information of a specific user

This method returns user information of a specific blog user identified by user ID.

<blogger.getUser>
            <userID>g453344533<userID>
</blogger.getUser>

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

Properties
  • userID:   The ID of the blog in which the post resides

             optional

Return Object

Returns a user resource.

 

Related Blogger API documentation

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

 



 

Date Time Format

Date and Time format for Blogger Connector follows the internet date/time format mentioned in RFC-3339 format. It can be summarized as follows

Typical Internet date/time formats.

1985-04-12T23:20:50.52Z

This represents 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC.

1996-12-19T16:39:57-08:00 This represents 39 minutes and 57 seconds after the 16th hour of December 19th, 1996 with an offset of -08:00 from UTC (Pacific Standard Time).Note that this is equivalent to 1996-12-20T00:39:57Z in UTC.

 


 

Specifying Fields

This specifies the fields of the JSON object Resource(Blog Resources,Post Resources,Comment Resources) that should be returned by the method. When the <fields> parameter tag is omitted the full JSON object is returned. This follows the format for receiving partial responses mentioned in Blogger API v3 that can be accessed from here.

The format of the <fields> request parameter value is loosely based on XPath syntax. The supported syntax is summarized below,

  • Use a comma-separated list to select multiple fields.
  • Use a/b to select a field b that is nested within field a; use a/b/c to select a field c nested within b.

    Exception: For API responses that use "data" wrappers, where the response is nested within a data object that looks like data: { ... }, do not include "data" in the fields specification. Including the data object with a fields specification like data/a/b causes an error. Instead, just use a fields specification like a/b.

  • Use a sub-selector to request a set of specific sub-fields of arrays or objects by placing expressions in parentheses "( )".

    For example: items(id,author/email) returns only the item ID and author's email for each element in the items array. You can also specify a single sub-field, where items(id) is equivalent to items/id.

  • Use wildcards in field selections, if needed.

    For example: items/pagemap/* selects all objects in a pagemap.


Example

Example 1

Following example shows how to get information about a specific blog requested by blog ID.

Example Code for getBlog method
<proxy xmlns="http://ws.apache.org/ns/synapse" name="getBlog"
    statistics="disable" trace="disable" transports="https,http">
    <target>
        <inSequence>
            <property action="set" expression="json-eval($.apiKey)" name="apiKey" scope="default" type="STRING"/>
            <property action="set" expression="json-eval($.accessToken)" name="accessToken" scope="default" type="STRING"/>
            <property action="set" expression="json-eval($.blogID)" name="blogID" scope="default" type="STRING"/>
            <property action="set" expression="json-eval($.maxPosts)" name="maxPosts" scope="default" type="STRING"/>
            <property action="set" expression="json-eval($.fields)" name="fields" scope="default" type="STRING"/>
            <blogger.init>
                <apiKey>{$ctx:apiKey}</apiKey>
                <accessToken>{$ctx:accessToken}</accessToken>
            </blogger.init>
            <blogger.getBlog>
                <blogID>{$ctx:blogID}</blogID>
                <maxPosts>{$ctx:maxPosts}</maxPosts>
                <fields>{$ctx:fields}</fields>
            </blogger.getBlog>
            <respond/>
        </inSequence>
        <outSequence>
            <log/>
            <send/>
        </outSequence>
    </target>
</proxy>
Request (JSON)
{
    "apiKey":"XXXXXXXEgOw2BRKmo4XXX-XXX-XXX",
    "accessToken":"EFEDDS231321mdadewq-asdfsadeiieqwer832432kmdskDDSFAsddfocewSKD-SEW",
    "blogID": "3453278989422",
    "maxPosts": "3",
    "fields":"" 
} 


Example 2

Following example shows how to list all posts with meta information for specific blog requested by blog ID.

Example Code for getBlog method
<proxy xmlns="http://ws.apache.org/ns/synapse" name="listPosts"
    transports="https,http" statistics="disable" trace="disable"
    startOnLoad="true">
    <target>
        <inSequence>
            <property name="apiKey" expression="json-eval($.apiKey)" />
            <property name="accessToken" expression="json-eval($.accessToken)" />
            <property expression="json-eval($.blogID)" name="blogID" />
            <property expression="json-eval($.fields)" name="fields" />
            <blogger.init>
                <apiKey>{$ctx:apiKey}</apiKey>
                <accessToken>{$ctx:accessToken}</accessToken>
            </blogger.init>
            <blogger.listPosts>
                <blogID>{$ctx:blogID}</blogID>
                <fields>{$ctx:fields}</fields>
            </blogger.listPosts>
            
            <respond />
        </inSequence>
        <outSequence>
            <log />
            <send />
        </outSequence>
    </target>
    <description />
</proxy>


Request (JSON)
{
    "apiKey":"XXXXXXXEgOw2BRKmo4XXX-XXX-XXX",
    "accessToken":"EFEDDS231321mdadewq-asdfsadeiieqwer832432kmdskDDSFAsddfocewSKD-SEW",
    "blogID": "3453278989422",
    "fields":"items(title,content)" 
} 

 




 



Navigate Up

 

  • No labels