Retrieve Nodes in SPAM

/services/v2/moderation/spam.json

The purpose of this API is to retrieve a list of all nodes rejected as spam status. This corresponds to content that would appear on the SPAM tab in the moderation. This function and queue are only available when the Akismet plugin is enabled and correctly configured.

A sort parameter may be used to return the list in order of when it was flagged as spam by the system or sent to spam by a moderator from other queues. This may be ordered as oldest first, newest first, or grouped by user.

🚧

Permissions & Notes:

  • You must have the permission called View Nodes in Moderation under Moderation Roles to make this API call.
  • Be sure to use pagination query parameter when making these calls

This functionality was added in the 2.19.0 Release

New Sort=oldest, Sort=newest, Sort=user parameters added in 2.21.0 release to align with the new sort feature in the UI.

Sample Request

https://apidocs.cloud.answerhub.com/services/v2/moderation/spam.json?sort=oldest&page=1&pageSize=10&space=8&space=9

-u answerhub:test123
-H "Accept: application/json"
-H "Content-type: application/json"
-X GET "https://apidocs.cloud.answerhub.com/services/v2/moderation/spam.json?sort=oldest&page=1&pageSize=10&space=8&space=9"

Sample Response

HTTP Error Response codes:

Success Response:

  • 200: Successfully Retrieved Node List

Error Responses:

  • 400: Bad Request - when for example, the user attempts to use another query param mode value (distinct to moderation/reported/spam)

  • 400: Bad Request - "error"; "Spam Akismet Plugin Disabled" will be displayed if the API call is made and the Akismet plugin is not enabled. Note: The plugin should also be correctly configured with valid Akismet API key to ensure full expected functionality.

  • 403: Forbidden - when the user doesn’t have the “View Nodes in Moderation” role granted

  • 404: Not found – when for example, the user has a typo on the wording of the endpoint

Language
Authorization
Basic
base64
:
Click Try It! to start a request and see the response here!