Community articleDeleting comments
Added by IBM contributorIBM on March 19, 2014
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

To delete a comment from a blog posting, use the HTTP DELETE method.



To delete a comment from a blog posting, use the HTTP DELETE method.

Only the owner of a blog or an administrator can delete a comment from it. Deleted comments cannot be restored.

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

To delete a comment, complete the following steps:

1. Retrieve the Blogs service document. See Retrieving 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. Send a GET request to the web address you copied from the previous step. In the returned feed, find the comment entry that you want to delete, and make a note of the web address for it, which is specified in the href attribute of its rel=edit link.
4. Send a DELETE request to the web address of the edit link of the comment that you noted in the previous step.

Input

None.

Output

None.

Input
Method URI Description
DELETE /blogs/{communityUuid}/api/comments/{commentId} Value of the href attribute of <link> element that contains a rel="edit" attribute value for each entry in the feed retrieved from the Comments Atom publishing collection address located in the blog's workspace in the Blogs service document.
Name Type Optional Description
communityUuid
string No Community UUID of the blog entry
commentId
string No The ID of the comment entry.
Output
Code Description
204
Indicates that the blog comment was successfully deleted (and no content is returned).
401
Unauthorized.
404
Not Found.