Create comments 

To add a comment to a blog posting, send a comment Atom entry document to the web address specified in the href attribute of the Comments <collection> element of the blog as specified in the service document or send the comment Atom entry document directly to the comments feed. Include the ID of the blog posting that you are commenting on in the comment Atom entry.

You can use the API to create and retrieve comments. However, after comments are created, they cannot be modified. Only the blog owner can delete comments.

See Authenticating requests for information about how to authenticate the request.

To create a blog comment...

  1. Retrieve the Blogs service document. See Retrieve the Blogs service document.

  2. In the service document, locate the workspace for the blog, locate the Comment Entries Atom collection within the workspace, and then copy the web address in the href attribute of the Comments collection.

  3. Determine the ID of the entry that you want to add the comment as a response to by getting a feed of the entries in the blog. You can do so by sending a GET request to the web address in the href attribute of the Weblog Entries collection. From the returned feed, find the blog of interest and the entry to which you want to add a comment. Copy the value of the <id> element for that entry.

  4. Send a POST request to the web address that you noted in the previous step. Pass a comment Atom entry document as input on the request. In the Atom document, define the entry that you want to add the comment to and the content of the comment itself.

Table 1. Atom API request details

Method Resource URI Input representation
POST Comments Value of the href attribute of the <collection> element with a child <title> element having a value of Comments in each blog workspace in the service document. comment
POST Comments /services/atom/{handle}/comments

Note: {handle} represents the blog handle. A handle is specified when a blog is first created and is used in the construction of web addresses used to query the entries in a blog.

Note: This resource was introduced in the 1.x version of the Blogs API. It is provided here for backwards compatibility.



Provide a comment Atom entry document.

Note: The content type of the Atom entry document must be application/atom+xml.

Note: If you are using the URL from the publishing API service document or the /services/atom/{handle}/comments resource to create a comment, provide the entry ID specified in the <thr:in-reply-to> element to indicate which entry the comment is for.


An Atom entry document containing the new blog comment.

Returned HTTP headers

HTTP/1.1 201 Created

Location: url

Error codes



> POST /blogs/myblog/api/comments HTTP/1.1
> Authorization: Basic xxx
> Host:
> Accept: */*
> Content-Type: application/atom+xml
> Content-Length: 353

Comment Atom entry document provided as input to the request:

<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns='' xmlns:thr="">
  <title type='text'>ignored</title>
  <thr:in-reply-to ref=""/>
  <content type='html'>
    I love to comment on topics.


< HTTP/1.1 201 Created
< Date: Tue, 03 Aug 2010 19:24:42 GMT
< Server: IBM_HTTP_Server
< X-LConn-Auth: false
< X-UA-Compatible: IE=EmulateIE7
< Expires: Thu, 1 Jan 1970 00:00:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate
< Location:
< Content-Location:
< Last-Modified: Tue, 03 Aug 2010 19:24:44 GMT
< Set-Cookie: ...
< Set-Cookie: ...
< Set-Cookie: JSESSIONID=...
< Transfer-Encoding: chunked
< Content-Type: application/atom+xml; type=entry
< Content-Language: en-US
<?xml version="1.0"?>
<entry xmlns="">
    <atom:title xmlns:atom="">
    <atom:category term="recommend" scheme="" xmlns:atom="">
    <app:categories fixed="yes"></app:categories>
  <snx:moderation status="approved" xmlns:snx=""></snx:moderation>
  <title type="text">Re: just below</title>
  <app:edited xmlns:app="">2010-08-03T19:24:44.351Z</app:edited>
    <name>Jim Smith</name>
    <snx:userid xmlns:snx="">4fda6cc0-0101-102e-88dd-f78755f7e0ed</snx:userid>
    <snx:userState xmlns:snx="">active</snx:userState>
  <content type="html">    I love tocomment on topics.  </content>
  <snx:trackbacktitle xmlns:snx="">Jim Smith</snx:trackbacktitle>
  <snx:rank scheme="" xmlns:snx="">0</snx:rank>
  <app:control xmlns:app="">
    <snx:approved xmlns:snx="">yes</snx:approved>
* Connection #0 to host left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):

Parent topic

Commenting on blog posts

Related reference
Blogs comment content
Navigate Blogs subscription API resources
Navigate Blogs publishing API resources