Query activities

Activities can be filtered by all their fields, and they support powerful combinations that allow you to

amongst many other excellent use cases.

This page will guide you through everything you need to know to construct creative filters to get great insights from your community.

Fields and types for filtering and sorting

The following table shows all the possible fields for which activities can be filtered and sorted. The filter type defines which type-specific operators can be used. All fields can be used with general operators and composition.

Sortable fields can always be sent as {fieldName}_{ASC | DESC}

FieldFilter typeExampleSortable
typeString{"type": "message"}✔️
platformString{"platform": "discord"}✔️
timestampDate{"timestamp": {"gte": "2022-01-01"}}✔️
titleString{"title": {"textContains": "issue title"}}✔️
bodyString{"body": {"textContains": "issue body"}}✔️
channelString{"channel": {"textContains": "dev"}}✔️
urlString{"url": {"textContains": "https://github.com/"}}✔️
sentimentNumber{"sentiment": {"lt": 50}}✔️
sentiment.[positive,negative,mixed,neutral]Number{"sentiment.mixed": {"gt": 70}}✔️
scoreNumber{"score": {"gt": 5}}✔️
memberIdString{"memberId": "918f26a1-5a8b-43d6-bbee-e7e1c5f805a6"}
conversationIdString{"memberId": "5a6bf0dd-4d06-4bd4-b37e-b0cba761d6b2"}
parentIdString{"memberId": "9cf6b6b1-2d25-4695-a91e-f79586af853a"}
sourceIdString{"sourceId": "12345"}✔️
sourceParentIdString{"sourceParentId": "12345"}✔️
isKeyActionBool{"isKeyAction": true}
tasksMany-to-Many{"tasks: ["94924f9e-b23e-463f-984e-f75a34f021aa"]}
createdAtDate{"createdAt": {"gte": "2022-01-01"}}✔️

Examples

Negative activities that either are part of a conversation or happened on Twitter

  • sentiment is lower than 50, and
  • either
    • conversationId is not null, or
    • platform is Twitter

Sorted by average sentiment.

{
    "filter": {
        "sentiment": {
            "lt": 50
        },
        "or": [
            {
                "platform": "twitter"
            },
            {
                "not": {
                    "conversationId": "NULL"
                }
            }
        ]
    },
    "orderBy": "sentiment_ASC",
    "limit": 20,
    "offset": 0
}

Activities of high score in specific channels that mention Python

  • channel is either support or bugs, but not dev, and
  • score is at least 5, and
  • either
    • title contains Python, or
    • body contains Python
{
    "filter": {
        "channel": {
            "in": [
                "support",
                "bugs"
            ],
            "not": "dev
        },
        "score": {
            "gte": 5
        },
        "or": [
            {
                "title": {
                    "textContains": "python"
                }
            },
            {
                "body": {
                    "textContains": "python"
                }
            }
        ]
    },
    "orderBy": "timestamp_ASC",
    "limit": 20,
    "offset": 0
}

New activities with terrible sentiment

  • timestamp is within a week, and
  • the sentiment is lower than 25
{
    "filter": {
        "timestamp": {
            "gte": "2022-01-01"
        },
        "sentiment": {
            "lt": 25
        }
    },
    "orderBy": "timestamp_ASC",
    "limit": 20,
    "offset": 0
}