To programmatically take action on a post that flagged as inappropriate, send an Atom entry document that defines the action you want to take to the moderation action feed.
Only the moderator can take action on a flagged posts.
See Authenticating requests
for information about how to authenticate the request.
To take action on a flagged post, complete the following steps:
Table 1. Atom API request details
- Retrieve the moderation service document. See Retrieving the Blogs moderation service document for more details.
- In the service document, locate the workspace with the <atom:category term="entries-moderation" .../> child element,and then find the collection with the <atom:category term="review-action" .../> child element, and make a note of the web address in its href attribute.
- Find the history link of the posting that you want to take action on by getting a list of flagged entries. See Getting a list of flagged posts for more details. Make a note of the href attribute of the <link> element that has the rel="http://www.ibm.com/xmlns/prod/sn/history" attribute for the entry representing the posting.
- Create an Atom entry document that defines the action you want to perform. In the <snx:moderation action="xxx" /> element, choose one of the following options:
Dismissed the flag, but does not change the status of the entry.quarantine
Removes the content from public view.restore
Dismisses all flags and changes the status to active.return
Removes the content from public view and asks the author to edit it.
Include a link element that identifies the posting you want to take action on. In the href attribute of the link element, include the web address from the history link that you made a note of in Step 3.
For example, to ignore the flag and keep the post published, the Atom entry document might contain the following content:
<name>ignored</name> <!-- taken from authenticated moderator user -->
<link rel="related" href="http://enterprise.example.com/blogs/home/api/
<snx:moderation action="restore" />
<content>The content of this entry is not objectionable according to
- Send a POST request to the web address that you noted in Step 2. Pass the Atom entry document that you created in the previous step as input on the request.
|POST||Change post-moderated content review status collection||Value of the href attribute of the <collection> element that has a <atom:category term="review-action" .../> child element in the moderation service document.||moderation action|
Provide a moderation action Atom entry document. The content type of the Atom entry document must be application/atom+xml.
Returned HTTP headers
HTTP/1.1 200 OK
Indicates that the entry was successfully moderated. If an error occurs, this header contains one of the error codes.Error codes
- HTTP/1.1 400 Bad Request
- HTTP/1.1 401 Unauthorized
- HTTP/1.1 403 Forbidden. Returned when the current user is authorized to the use the API, but cannot moderate the specified content.
- HTTP/1.1 404 Not Found. Indicates that the content is no longer available.
> POST /blogs/home/api/actions/review/entries HTTP/1.1
> Authorization: Basic xxx
> Host: enterprise.example.com
> Accept: */*
> Content-Type: application/atom+xml
> Content-Length: 509
Parent topic: Working with flagged blog posts
Moderation action entry content
< HTTP/1.1 200 OK
< Date: Tue, 03 Aug 2010 20:18:51 GMT
< Server: IBM_HTTP_Server
< Content-Length: 0
< Content-Type: text/plain
< Content-Language: en-US