Get Filtered Threads

Gets all existing filter parameters. The filter has one limitation – the interval between parameters start and end cannot be bigger than 90 days.

Permissions

  ----
  Permissions:INTEGRATOR,SUPERVISOR
  ----

Request Parameters

KeyTypeDescriptionExample
startdateBeginning of the interval when the threads were created. The default value is the current day minus 1 day.2021-07-
15T21:00:00.000Z
enddateEnd of the interval when the threads were created. The default value is the current day.2021-07-
15T21:00:00.000Z
lengthlongThread duration in seconds. It is used in conjunction with the lengthOperator parameter350
lengthOperatorstringComparison operator specified for the length parameterOne of the following:

LESS
GREATER
EQUAL
LESS_EQUAL
GREATER_EQUAL
firstTimeAnswerlongNumber of seconds until an agent’s first response in the thread. It is used in conjunction with the firstTimeAnswerOperator parameter60
firstTimeAnswerOperatorstringComparing operator specified for the firstTimeAnswer parameterOne of the following:

LESS
GREATER
EQUAL
LESS_EQUAL
GREATER_EQUAL
messageCountlongMessage count. It is used in conjunction with the messageCountOperator parameter10
messageCountOperatorstringComparing operator specified for the messageCount parameterOne of the following:

LESS
GREATER
EQUAL
LESS_EQUAL
GREATER_EQUAL
statusstringThread status options. Every option contains several thread statuses as follows:

QUEUED_STATES option: NEW, UNASSIGNED, SUSPENDED
WORKING_STATES option: ASSIGNED, ANSWER_NEEDED, WAITING, IN_PROGRESS, REASSIGNED
CLOSED_STATES option: CLOSED
One of:

QUEUED_STATES
WORKING_STATES
CLOSED_STATES
channelslong arrayList of channel IDs in edna. To get IDs of existing channels, contact our support team or check the ‘channels’ table if edna is hosted on your server.1,3,7
emailAccountslong arrayEmail account ID list.

When used in conjunction with the channels parameter, use the OR operator between these parameters.
1,2,5
operatorslong arrayAgent ID list1,5,8
tagslong arrayYour tag ID list in edna. To get IDs of existing tags, contact our support team or check the tags table if edna is hosted on your server.2,4,6
clientstringString that is used to find the client by externalClientId, name, username, email or phone.SomeUserName
79000000000

Curl Example

$ curl 'http: //localhost:8080/api/v1/threads/filter?start=2022-02- 03T07%3A59%3A05.290Z&end=2022-02-04T07%3A59%3A05.290Z&length=600&lengthOperator=GREATER&messageCount=3&messageCountOperator=GREATER_EQUAL&firstAnswerTime=1000&firstAnswerTimeOperator=LESS_EQUAL&status=CLOSED_STATES&channelTypes=WEB&channelTypes=MOBILE&operators=1&operators=2&operators=3&tags=1&tags=5&page=1' -i -X GET \
-H 'Authorization: Bearer <integrator_token>'

Request Variables

ParameterTypeDescription
length string Thread duration
• lengthOperator
• messageCountOperator
• firstAnswerTimeOperator
 string Comparison operators:

LESS
GREATER
EQUAL
LESS_EQUAL
GREATER_EQUAL
message count number Number of messages
firstAnswerTime number Agent’s response time
status string One of:

QUEUED_STATES
WORKING_STATES
CLOSED_STATES
tags number Tag ID in the database

HTTP Request

GET /api/v1/threads/filter?start=2022-02-03T07%3A59%3A05.290Z&end=2022-02-04T07%3A59%3A05.290Z&length=600&lengthOperator=GREATER&messageCount=3&messageCountOperator=GREATER_EQUAL&firstAnswerTime=1000&firstAnswerTimeOperator=LESS_EQUAL&status=CLOSED_STATES&channelTypes=WEB&channelTypes=MOBILE&operators=1&operators=2&operators=3&tags=1&tags=5&page=1 HTTP/1.1
Authorization: Bearer <integrator_token>
Host: localhost: 8080

Example of a Successful HTTP Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 2740
{
    "count": 5,
    "pages": 1,
    "threads": [
        {
            "id": 1,
            "startTime": "2022-02-03T21:00:00.000Z",
            "clientId": 1,
            "clientName": "client name",
            "clientPhone": "8-900-800-7060",
            "externalClientId": "111",
            "blocked": false,
            "blockRequested": false,
            "operator": {
                "id": 1,
                "name": "operator name",
                "role": "OPERATOR",
                "freeSlots": 0,
                "photoUrl": null
            },
            "channel": "WEB",
            "initialChannel": null,
            "state": "IN_PROGRESS",
            "tags": [],
            "questionAnswer": null
        },
        {
            "id": 2,
            "startTime": "2022-02-03T21:00:00.000Z",
            "clientId": 1,
            "clientName": "client name",
            "clientPhone": "8-900-800-7060",
            "externalClientId": "111",
            "blocked": false,
            "blockRequested": false,
            "operator": {
                "id": 1,
                "name": "operator name",
                "role": "OPERATOR",
                "freeSlots": 0,
                "photoUrl": null
            },
            "channel": "WEB",
            "initialChannel": null,
            "state": "WAITING",
            "tags": [],
            "questionAnswer": null
        },
        {
            "id": 3,
            "startTime": "2022-02-03T21:00:00.000Z",
            "clientId": 2,
            "clientName": "client name 2",
            "clientPhone": "8-900-800-7061",
            "externalClientId": "222",
            "blocked": false,
            "blockRequested": true,
            "operator": {
                "id": 2,
                "name": "operator name 2",
                "role": "OPERATOR",
                "freeSlots": 0,
                "photoUrl": null
            },
            "channel": "MOBILE",
            "initialChannel": null,
            "state": "REASSIGNED",
            "tags": [],
            "questionAnswer": null
        },
        {
            "id": 4,
            "startTime": "2022-02-03T21:00:00.000Z",
            "clientId": 2,
            "clientName": "client name 2",
            "clientPhone": "8-900-800-7061",
            "externalClientId": "222",
            "blocked": false,
            "blockRequested": true,
            "operator": {
                "id": 2,
                "name": "operator name 2",
                "role": "OPERATOR",
                "freeSlots": 0,
                "photoUrl": null
            },
            "channel": "MOBILE",
            "initialChannel": null,
            "state": "ANSWER_NEEDED",
            "tags": [],
            "questionAnswer": null
        },
        {
            "id": 5,
            "startTime": "2022-02-03T21:00:00.000Z",
            "clientId": 3,
            "clientName": null,
            "clientPhone": null,
            "externalClientId": "3",
            "blocked": true,
            "blockRequested": false,
            "operator": {
                "id": 2,
                "name": "operator name 2",
                "role": "OPERATOR",
                "freeSlots": 0,
                "photoUrl": null
            },
            "channel": "MOBILE",
            "initialChannel": null,
            "state": "WAITING",
            "tags": [],
            "questionAnswer": null
        }
    ]
}
Get Threads by Status and Agent Logins
Next Article Assign Threads to Agents