Community articleActing on a flagged community file
Added by IBM contributorIBM on March 25, 2014
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

To programmatically take action on a community file that has been flagged as inappropriate, send an Atom entry document that defines the action you want to take to the moderation action feed.



To programmatically take action on a community file that has been 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 file.

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

To take action on a flagged file, complete the following steps:


The following table defines the supported state transitions for a file:


All other state transitions are invalid and throw a 400 Bad Request HTTP Response code and return an error code of ConstraintViolation.
1. Retrieve the moderation service document. See Retrieving the Files moderation service document for more details.
2. In the service document, locate the workspace with the <category term="documents-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.
3. Find the entry that represents the file that you want to take action on by getting a list of flagged entries. See Getting a list of flagged community files for more details. Make a note of the value of the <td:uuid> element of the entry representing the file.
4. 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:
5. 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.

Input

Provide a moderation action Atom entry document. The content type of the Atom entry document must be application/atom+xml.

Output

None.
Input
Method URI Description
POST /files/basic/api/review/actions/documents Value of the href attribute of the <collection> element that has a <atom:category term="review-action" .../> child element in the moderation service document.
Content Type: application/atom+xml
Output
Code Description
204
Indicates that the entry was successfully moderated. If an error occurs, this header contains one of the error codes.
400
Bad Request.
401
Unauthorized.
403
Forbidden. Returned when the current user is authorized to the use the API, but cannot moderate the specified content.
404
Not Found. Indicates that the content is no longer available.
Examples
> POST files/basic/api/review/actions/documents HTTP/1.1

> Authorization: Basic xxx

> Host: enterprise.example.com

> Accept: */*

> Content-Type: application/atom+xml

> Content-Length: 509


Response returned by the server
< HTTP/1.1 204 No Content