# Agent Performance

## Agent List

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/analytics/agent/agent-list`

Retrieve a list of agent data including their name, ID, department, role, rating, online status, and channel access.

#### Query Parameters

| Name   | Type   | Description                                                                                                                                         |
| ------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| search | string | Search for an agent by name or email.                                                                                                               |
| page   | string | Page number for which you want agent records if you are using pagination. If you are not passing a limit or page then it will retrieve all records. |
| limit  | string | Number of records you want in one call. If you are not passing a limit or page then it will retrieve all records.                                   |

#### Headers

| Name          | Type   | Description                       |
| ------------- | ------ | --------------------------------- |
| Authorization | string | Bearer \*\*\*YOUR\_API\_KEY\*\*\* |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "agents_list": {
      "data": [
        {
          "id": 1,
          "name": "Test Agent",
          "email": "test@acquire.io",
          "image": null,
          "department": "Analytics12",
          "role": "Administrator",
          "rating": 3.25,
          "isOnline": "online",
          "stateChat": "yes",
          "stateMail": "yes",
          "stateVoip": "yes"
        }
      ],
      "totalCount": 1,
      "success": true
    }
  }
}
```

{% endtab %}
{% endtabs %}

## Agent Graph Data

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/analytics/agent/graph-data`

View agent metrics, including ratings, response times, and total conversations across all channels. The `agent_id` must be passed in to the endpoint as a query parameter.&#x20;

#### Query Parameters

| Name        | Type   | Description                                                                                                                                  |
| ----------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| agent\_id   | string | Pass the ID of an agent for which you want to get data.You can get the agent\_id by calling agent list endpoint mentioned above.             |
| start\_date | string | Date From (Date format = YYYY-MM-DD hh:mm:ss, e.g 2021-01-01 00:00:00)                                                                       |
| end\_date   | string | Date End (Date Format = YYYY-MM-DD hh:mm:ss, e.g 2021-01-01 23:59:59)                                                                        |
| offset      | string | This parameter is used for the timezone value and the default timezone will be "GMT". e.g. +05:30 for particular timezone. Default is +00:00 |
| output      | string | json or csv                                                                                                                                  |

#### Headers

| Name          | Type   | Description                       |
| ------------- | ------ | --------------------------------- |
| Authorization | string | Bearer \*\*\*YOUR\_API\_KEY\*\*\* |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "agentStatistics": {
      "data": {
        "graphRow": {
          "labels": [
            "03 PM",
            "04 PM",
            "05 PM",
            "06 PM",
            "07 PM",
            "08 PM",
            "09 PM",
            "10 PM",
            "11 PM",
            "12 AM",
            "01 AM",
            "02 AM",
            "03 AM",
            "04 AM",
            "05 AM",
            "06 AM",
            "07 AM",
            "08 AM",
            "09 AM",
            "10 AM",
            "11 AM",
            "12 PM",
            "01 PM",
            "02 PM"
          ],
          "totalConversations": [
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "totalChats": [
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "totalMissed": [
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "averageResponseTime": [
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0
          ],
          "login_scale": [
            {
              "class": "off",
              "val": 96.27,
              "diff": 83177,
              "label": "03:44:03 PM to 02:50:20 PM (23 hours 6 minutes 17 seconds)"
            },
            {
              "class": "on",
              "val": 3.23,
              "diff": 2787,
              "label": "02:50:21 PM to 03:36:48 PM (0 hours 46 minutes 27 seconds)"
            },
            {
              "val": 0.5,
              "class": "off",
              "diff": 433,
              "label": "03:36:49 PM to 03:44:02 PM (0 hours 7 minutes 13 seconds)"
            }
          ]
        },
        "summary": {
          "totalConversations": {
            "current": 0,
            "previous": 0,
            "info": "Includes all chats, calls and emails handled by an agent."
          },
          "totalChats": {
            "current": 0,
            "previous": 0
          },
          "totalMissed": {
            "current": 0,
            "previous": 0
          },
          "totalVoip": {
            "current": 0,
            "previous": 0
          },
          "totalVoipSms": {
            "current": 0,
            "previous": 0
          },
          "totalEmails": {
            "current": 0,
            "previous": 0
          },
          "totalPrivateForms": {
            "current": 0,
            "previous": 0
          },
          "averageRating": {
            "current": 0,
            "previous": 0
          },
          "averageResponseTime": {
            "current": 0,
            "previous": 0
          }
        }
      },
      "success": true,
      "output": "json"
    }
  }
}
```

{% endtab %}
{% endtabs %}

## Agent Leaderboard

<mark style="color:blue;">`GET`</mark> `https://{{account_id}}.acquire.io/api/v1/analytics/agent/agent-leaderboard`

Retrieve a list of agent rankings. Agents are ranked by rating and number of cases solved.

#### Query Parameters

| Name               | Type   | Description                                                                                                                                                                                                                                                                                             |
| ------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| filter.role        | array  | <p>Array of integers. List of role ids for which API will return details of cases for agent.<br><br>Ex. \[1,2]</p>                                                                                                                                                                                      |
| filter.departments | array  | <p>Array of integers. List of department ids for which API will return details of cases for agent.<br><br>Ex. \[1,2]</p>                                                                                                                                                                                |
| filter.channel     | array  | <p>List of channels for which API will return details of cases for agent.<br><br>Ex. \[var \_utcDate = new Date(localDate.getUTCFullYear(), localDate.getUTCMonth(), localDate.getUTCDate(), localDate.getUTCHours(), localDate.getUTCMinutes(), localDate.getUTCSeconds());'chat', 'mail', 'voip']</p> |
| search             | string | You can pass text that will be applicable to search in agent name or email.                                                                                                                                                                                                                             |
| limit              | string | Number of records you want in one call. If you are not passing a limit or page then it will retrieve all records.                                                                                                                                                                                       |
| page               | string | Page number for which you want agent records if you are using pagination. If you are not passing a limit or page then it will retrieve all records.                                                                                                                                                     |
| start\_date        | string | Date From (Date format = YYYY-MM-DD hh:mm:ss, e.g 2021-01-01 00:00:00)                                                                                                                                                                                                                                  |
| end\_date          | string | Date End (Date Format = YYYY-MM-DD hh:mm:ss, e.g 2021-01-01 23:59:59)                                                                                                                                                                                                                                   |
| offset             | string | This parameter is used for the timezone value and the default timezone will be "GMT". e.g. +05:30 for particular timezone. Default is +00:00                                                                                                                                                            |
| output             | string | json or csv                                                                                                                                                                                                                                                                                             |

#### Headers

| Name          | Type   | Description                       |
| ------------- | ------ | --------------------------------- |
| Authorization | string | Bearer \*\*\*YOUR\_API\_KEY\*\*\* |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "agentLeaderboard": {
      "data": {
        "responseData": [
          {
            "id": 12,
            "email": "viswanath.sarma@acquire.io",
            "departments": "voip,email",
            "role": "Administrator",
            "solvedCases": 21,
            "totalTimeSpent": 127,
            "avgTimeSpentPerCase": 6,
            "averageResponseTime": 5,
            "averageRatingFeedback": 0,
            "agent": {
              "name": "viswanath",
              "photo": null
            }
          },
          {
            "id": 18,
            "email": "checksum@gmail.com",
            "departments": "voip",
            "role": "Administrator",
            "solvedCases": 0,
            "totalTimeSpent": 0,
            "avgTimeSpentPerCase": 0,
            "averageResponseTime": 0,
            "averageRatingFeedback": 0,
            "agent": {
              "name": "checksusms",
              "photo": null
            }
          }
        ],
        "totalRecords": 2
      },
      "success": true,
      "output": "json"
    }
  }
}

```

{% endtab %}
{% endtabs %}
