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

To update a reply to a topic in a community forum, send an updated forum reply document in Atom format to the existing reply's edit web address.
Tags: commapi



To update a reply to a topic in a community forum, send an updated forum reply document in Atom format to the existing reply's edit web address.

All existing forum reply information will be replaced with the new data. To avoid deleting all existing data, retrieve any data you want to retain first, and send it back with this request. See Retrieving forum replies for more information. If you want to delete a reply and provide a customized message about why the reply was removed, send this request without first retrieving the reply data and include a <category scheme="http://www.ibm.com/xmlns/prod/sn/flags term="deleted"> element in the entry content. See Deleting forum replies for more information.

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

Input

Provide a forum reply Atom entry document.

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

If you want to accept this reply as an answer to a question topic, add the <category scheme="http://www.ibm.com/xmlns/prod/sn/flags" term="answer"/> element to the reply entry document that you pass in as input.

If you want to decline this reply as an answer to a question topic, remove the <category scheme="http://www.ibm.com/xmlns/prod/sn/flags" term="answer"/> element from the reply entry document that you pass in as input.

To add an attachment to a reply entry without any, send the modified entry document with an attachment using a multipart PUT request. On a successful PUT, metadata for the attachment will be added to the entry. For example:

<snx:field name="resume" fid="id of the attached file node" ...>
<link href="link to the attachment" />
</snx:field>


To update a reply entry that already has file attachments, send the modified entry document with an attachment using a multipart PUT request. On a successful PUT, metadata for the attachment will be added to the entry. For example:

<snx:field name="resume" fid="id of the attached file node" ...>
<link href="link to the attachment" />
</snx:field>


Any file snx:fields that you want to keep must be present in the entry document. Otherwise, they will be removed from the entry.

To remove an attachment, remove the snx:field for the file from the reply entry document's metadata, and then send a PUT request.

Output

None.

Input
Method URI Description
PUT /forums/atom/reply Value of the href attribute of the <link> element that has a rel="edit" attribute value for each entry in the forum replies feed.
Content Type: application/atom+xml
Name Type Optional Description
replyUuid
string No The UUID of the reply you wish to update
Output
Code Description
200
OK. Indicates that the forum reply was successfully updated. If an error occurs, this header contains one of the error codes.
401
Unauthorized.
404
Not Found.