Aggregated statistics for employees

Method get.employee_stat
Description Getting aggregated statistics on employees
The method is available when the "call_center" component is connected
Available to Agent, Client

Request parameters

Title Type Required Description
access_token string yes Authentication session key
user_id number no Unique user identifier of the client agent on behalf of which the request is made
Is required for the agent
To obtain a list of client users, you must use the method "get.customer_users"
limit number no Number of records returned. See section "Paging"
offset number no Shift determines from which record number to return "limit" records. Default is "0". See section "Paging"
filter object no See section "Filtering criteria"
fields array no See section "View of returned data"
sort array no See section "Sorting data"
date_from iso8601 yes YYYY-MM-DD hh:mm:ss
date_till iso8601 yes YYYY-MM-DD hh:mm:ss
only_default_statuses_in_stats boolean no A sign that allows you to select a statistics option based on the time spent in statuses. Default is "true".

Response parameters

Name Type Valid values Filtering Sorting Description
id number yes Unique employee identifier
first_name string yes yes Employee name
last_name string yes yes Employee's last name
patronymic string yes Employee's middle name
full_name string yes yes Last name First name Patronymic
Information on employee status
status_stats object yes Statistics of employee statuses. To get a complete list of statuses, you must use the "get.statuses" method. The contents of the parameter depend on the only_default_statuses_in_stats parameter:
  • if the value is true, the key is the status mnemonic, the value is time in seconds
  • if the value is false, the key is a unique status identifier, the value is time in seconds, statistics on deleted statuses are also available if there is data for the selected period
Employee groups
groups array yes Groups in which the employee belongs
group_id number Unique group identifier
group_name string Group name

JSON request structure```json

{ "jsonrpc": "2.0", "id": "number", "method": "get.employee_stat", "params": { "access_token": "string", "user_id": "number", "offset": "number", "limit": "number", "date_from": "iso8601", "date_till": "iso8601", "filter": {}, "sort": [ { "field": "string", "order": "string" } ], "fields": [ "string" ] } }

### JSON response structure```json
{
  "jsonrpc": "2.0",
  "id": "number",
  "result": {
    "metadata": {},
    "data": [
      {
        "id": "number",
        "first_name": "string",
        "last_name": "string",
        "patronymic": "string",
        "full_name": "string",
        "groups": [
          {
            "group_name": "string",
            "group_id": "number"
          }
        ],
        "status_stats": {
          "string": "number"
        }
      }
    ]
  }
}

List of returned errors

See the section "List of errors for methods with the verb get"