Start a conversation

Retrieve Abuse Reports by Content Filter

Learn about how to retrieve abuse reports by content filter from the Abuse dashboard.

In this guide, you will learn how to retrieve abuse reports by content filter from the Abuse dashboard using GraphQL API.

Moderators use these abuse reports to filter and moderate the content for their community based on their policies.

With the abuse reports, you can either ban the member or reject the abuse report.

To retrieve the abuse reports by the content filter, you must have Moderator role granted to you by your administrator.

Basic Steps

  1. Generate the API session key using the POST/v1/authentication/sessions/login endpoint.
  2. Use this session key and a GraphQL query to authorize and retrieve the abuse reports.
  3. Filter the entity based on your preference and company policies.
  4. Use the entityId to either ban the member or reject the abuse report.

Example

For our example, we are going to retrieve the abuse report from the dashboard for the private notes.

Generate the API session key using the following request:

https://<YOUR COMPANY DOMAIN>/restapi/v1/authentication/sessions/login?user.login=<USERNAME>&user.password=<YOUR PASSWORD>

The generated session key is <YOUR SESSION KEY>.

Use this key to retrieve the session key.

query filterEvents($constraints: FilterEventConstraints, $sorts: FilterEventSorts)  {
    filterEvents (constraints: $constraints, sorts: $sorts) {
        totalCount
        pageInfo {
            hasPreviousPage
            hasNextPage
            startCursor
            endCursor
        }
        edges {
            node {
                eventId
                entityType
                entityId
                user {
                    id
                    login
                    email
                    firstName
                    lastName
                }
                nodeType
                nodeId
                title
                action
                timestamp
                words
                filters
                note {
                    ... on PrivateConversation {
                        id
                        statusType
                    }
                    ... on PrivateNote {
                        id
                        statusType
                    }
                }
            }
        }
    }
}

The variables to use with the query are:

{
    "constraints" : {
        "eventEntityType" : {
            "eq" : "NOTES"
        },
        "filterAction": {
            "eq" : "REPLACE"
        }
    },
    "sorts": {
        "timestamp" : {
            "direction": "DESC"
        }
    }
}

Example Response

{
    "data": {
        "filterEvents": {
            "totalCount": 3,
            "pageInfo": {
                "hasPreviousPage": false,
                "hasNextPage": false,
                "startCursor": null,
                "endCursor": null
            },
            "edges": [
                {
                    "node": {
                        "eventId": 1582556,
                        "entityType": "NOTES",
                        "entityId": 199,
                        "user": {
                            "id": "user:94",
                            "login": "annu2",
                            "email": "annu.a+annu2@khoros.com",
                            "firstName": "Annus",
                            "lastName": "Dizoosa"
                        },
                        "nodeType": "threaded_note",
                        "nodeId": "142",
                        "title": "iAmAReplacedWord",
                        "action": "replace",
                        "timestamp": 1690348053000,
                        "words": [
                            "prick"
                        ],
                        "filters": [
                            "Content filter"
                        ],
                        "note": {
                            "id": "threaded_note:199",
                            "statusType": "REJECTED"
                        }
                    }
                },
                {
                    "node": {
                        "eventId": 1582500,
                        "entityType": "NOTES",
                        "entityId": 198,
                        "user": {
                            "id": "user:94",
                            "login": "annu2",
                            "email": "annu.a+annu2@khoros.com",
                            "firstName": "Annus",
                            "lastName": "Dizoosa"
                        },
                        "nodeType": "threaded_note",
                        "nodeId": "121",
                        "title": "filter action is replace123",
                        "action": "replace",
                        "timestamp": 1690346522000,
                        "words": [
                            "venda",
                            "action"
                        ],
                        "filters": [
                            "Content filter",
                            "actionno"
                        ],
                        "note": {
                            "id": "threaded_note:198",
                            "statusType": "REJECTED"
                        }
                    }
                },
                {
                    "node": {
                        "eventId": 1580483,
                        "entityType": "NOTES",
                        "entityId": 142,
                        "user": {
                            "id": "user:94",
                            "login": "annu2",
                            "email": "annu.a+annu2@khoros.com",
                            "firstName": "Annus",
                            "lastName": "Dizoosa"
                        },
                        "nodeType": "notes_thread",
                        "nodeId": "null",
                        "title": "venda",
                        "action": "replace",
                        "timestamp": 1690288196000,
                        "words": [
                            "venda",
                            "*as*"
                        ],
                        "filters": [
                            "Checking different combination",
                            "Content filter"
                        ],
                        "note": {
                            "id": "notes_thread:142",
                            "statusType": "REJECTED"
                        }
                    }
                }
            ]
        }
    }
}

From the above reports, we are going to ban Annus Dizoosa.

Ban a Member

To ban a member, create a POST request to ban Annus Dizoosa:

mutation createBan($banInput: BanInput!) {
    createBan(banInput : $banInput, revokeKudos: false, rejectContent: false) {
        result {
            id
            userId
            ipRegexp
            loginExact
            loginRegexp
            isOr
            emailExact
            emailRegexp
            minutesToBan
            bannedReason
            publicBannedReason
        }
        errors {
            __typename
            ... on Error {
                message
            }
        }
    }
}

Variables:

{
    "banInput" : {
        "userId": 94,
        "ipRegexp": "",
        "loginRegexp": "",
        "emailRegexp": "annu.a+annu2@gmail.com",
        "loginExact": true,
        "emailExact": false,
        "isOr": false,
        "minutesToBan": 6,
        "bannedReason": "banned",
        "publicBannedReason": "Abuse content"
    },
    "rejectContent" : false,
    "revokeKudos" : false
}

Ban Member Response

{
    "data": {
        "createBan": {
            "result": {
                "id": "27",
                "userId": 94,
                "ipRegexp": "*",
                "loginExact": true,
                "loginRegexp": "",
                "isOr": false,
                "emailExact": false,
                "emailRegexp": "annu.a+annu2@gmail.com",
                "minutesToBan": 6,
                "bannedReason": "banned",
                "publicBannedReason": "Abuse content"
            },
            "errors": null
        }
    }
}

Reject the Abuse

In this section, we are going to reject the abuse for entityId 142.

To reject the abuse, create a POST request with the following mutation and variables:

mutation rejectAsAbuse($entityId: ID!) {
    rejectAsAbuse(
        entityId: $entityId
    ) {
        result
        errors {
            __typename
            ... on PermissionDeniedError {
                message
            }
        }
    }
}

Variables:

{
   "entityId": "message:142"
}
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. ATLAS

  2. Posted
  3. Updated

Comments