Community articleCreating a community forum reply programmatically
Added by IBM contributorIBM on April 3, 2014
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

To post a reply to a topic in a community forum, send an Atom entry document containing the forum reply to the forum replies resource.
Tags: commapi

To post a reply to a topic in a community forum, send an Atom entry document containing the forum reply to the forum replies resource.

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

To create a community forum reply, complete these steps:

1. Retrieve the service document to discover the web address of the My Communities feed.
2. Retrieve the My Communities feed, and then find the community to which you want to add the topic reply. Make a note of the web address in the href attribute of the rel="edit" <link> element.
3. Send a GET request to the web address you noted in the previous step to retrieve the Atom entry document for the community. Look for the entry that represents the topic you want to reply to. Make a note of the web address of the rel="replies" <link> element.
4. Send a POST request to the web address you noted in the previous step. Pass in to the request an Atom entry document that represents the reply you want to post.


Provide a forum reply Atom entry document.

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

To create a reply with an attachment, use a multipart post in the request. See Creating a stand-alone forum topic programmatically for more details.


An Atom entry document containing the new forum reply.


Entry document provided as input:

<?xml version="1.0" encoding="UTF-8"?>
<title type="text">Have you tried The Children's Place?</title>
<category scheme="" term="forum-reply"/>
<category scheme="" term="answer"/>
<content type="html">Have you tried The Children's Place?</content>

Method URI Description
POST /forums/atom/replies Value of the href attribute of the <link> element with the rel="replies" attribute value in the forum topics feed.
Content Type: application/atom+xml
Sample Request:
<?xml version="1.0" encoding="UTF-8"?>
        <title type="text">Stage Test Community DT Topics and Replies</title>
    <title type="text">Re: test topic dt</title>
    <category term="NotRecommendedByCurrentUser" scheme=""></category>
    <category term="forum-reply" scheme=""></category>
        xmlns:thr="" ref="" href="" type="application/atom+xml">
    <content type="html">
    &lt;p dir="ltr"&gt;
      REPLY POST test
Name Type Optional Description
string No Uuid of the topic you wish to reply to.
Content Type: application/atom+xml
Name Type Optional Description
string No Link to edit_url of the forum reply. You can use the web address specified here to subsequently retrieve and update the forum reply.
Code Description
Created. Indicates that the forum reply was successfully created. If an error occurs, this header contains one of the error codes.
Bad Request.
> POST /forums/atom/replies?topicUuid=37538e0f-6791-4fc9-9798-8f9c8206ae09 HTTP/


> Authorization: xxx

> Host:

> Accept: */*

> Content-Type: application/atom+xml

> Content-Length: 821

Response returned by the server
< HTTP/1.1 201 Created


<?xml version="1.0" encoding="UTF-8"?><entry xmlns=""

 xmlns:app="" xmlns:snx="

/sn" xmlns:thr=""><id>

um:62812540-dce1-41cb-9dd3-504417252d56</id><title type="text">Have you tried Th

e Children's Place?</title><published>2010-09-14T23:19:29.743Z</published><updat


l><name>Amy Jones6</name><snx:userid>50730340-0101-102e-88e1-f78755f7e0ed</snx:u

serid><snx:userState>active</snx:userState></author><link href="https://lc30linu

2d56" rel="self" type="application/atom+xml"></link><link href="https://lc30linu

2d56" rel="edit" type="application/atom+xml"></link><category term="forum-reply"

 scheme=""></category><category term="answe

r" scheme=""></category><link href="https:


206ae09#62812540-dce1-41cb-9dd3-504417252d56" rel="alternate" type="text/html"><

/link><link href="

uid=62812540-dce1-41cb-9dd3-504417252d56" rel="replies" type="application/atom+x

ml" thr:count="0"></link><thr:in-reply-to ref="

791-4fc9-9798-8f9c8206ae09" href="

m/topics?forumUuid=37538e0f-6791-4fc9-9798-8f9c8206ae09" type="application/atom+

xml"></thr:in-reply-to><content type="html">

    Have you tried The Children's Place?

  </content><snx:permissions>none, create_forum, view_forum, edit_forum, del_for

um, create_post, edit_personal_post, edit_all_post, del_personal_post, del_all_p

ost, pin_topic, subscribe, lock_node, create_topictag, del_all_topictag, del_per

sonal_topictag, create_forumtag, del_all_forumtag, del_personal_forumtag, view_c

ategory, edit_personal_question, edit_all_question</snx:permissions></entry>* Co

nnection #0 to host left intact

* Closing connection #0

* SSLv3, TLS alert, Client hello (1):