How to view statistics of employees’ activity and clock-in/out records

To get employee's activity statistics: api_employee_activity

Request:

{
    "server_token": "...",
    "app_version": "...",
    "controller": "api_employee_activity",
    "query": {
        "interval":[1393632e3,1395964799],
        "employees":[1],
        "columns":
        {
            "schedule_type":1,
            "activity_type":1,
            "visible_columns":[1,2]
        }
    }
}
intervaltime period for which the statistics are returned. The beginning and the end of the interval are set as a number of seconds starting from 01.01.1970;
employeeslist of employees’ IDs for which the statistics are returned.

"schedule_type":
1 — work time, 
2 — scheduled time, 
3 — non-scheduled time

"activity_type":
1 — all types, 
2 — computer, 
3 — non-computer

"visible_columns" — columns to be returned: 
1 — worked time in seconds, 
2 — productive time in seconds
3 — non-productive time in seconds, 
4 — non-core time in seconds, 
5 — unknown time in seconds, 
6 — number of schedule violations, 
7 — number of times being late, 
8 — number of times leaving early, 
9 — number of absences, 
10 — lateness time in seconds, 
11 — average lateness time in seconds, 
12 — early leave time in seconds, 
13 — average early leave time in seconds, 
14 — number of days worked, 
15 — amount of time worked in seconds, 
16 — work hours in seconds, 
17 — number of working days according to schedule, 
18 — total overtime in seconds.
"schedule_type" and "activity_type" only affect calculation of columns 1, 2, 3, 4, and 5.

Response:

{
"items":
[{
"employee_id": 1,
"first_name": "Иван",
"second_name": "Петров",
"schedule_day_count": 40,
"work_day_count": 39,
"nonspecialized_time": 98914,
"late_time": 52974,
"late_count": 9,
"work_time": 1140446,
"permitted_time": 905906,
"forbidden_time": 69723,
"early_end_count": 3,
"early_end_time": 18812,
"absenteeism": 3,
"unknown_time": 90017,
"incident_count": 15,
"norm": 1296000 
}]
}

itemsList of employees with statistics for each of employees;
employee_idEmployee’s ID;
first_nameEmployee’s name;
second_nameEmployee’s surname;
schedule_day_countNumber of workdays accoring to a schedule;
work_day_countNumber of days worked;
nonspecialized_timeNon-core time in seconds;
late_timeLateness time in seconds;
late_countNumber of times being late;
work_timeWorked time in seconds;
permitted_timeProductive time in seconds;
forbidden_timeNon-productive time in seconds;
early_end_countNumber of times leaving early;
early_end_timeEarly leave time in seconds;
absenteeismNumber of absences;
unknown_timeUnknown time in seconds;
incident_countNumber of schedule violations;
normWork hours in seconds;
diffTotal overtime in seconds.

To get employees' clock-in/out records: api_employee_work_periods

Request:

{
    "server_token": "...",
    "app_version": "...",
    "controller": "api_employee_activity",
    "query": {
        "day":1393632000,
        "employees":[120]
    }
}
dayday for which the statistics is returned. The day is set as the number of seconds starting from 01.01.1970 until 00:00:00 of the day.
employeesa list of employees’ ID for whom clock-in and clock-out times are requested.

Response:

{
"items":
[{
"employee_id": 120,
"first_name": "Иван",
"second_name": "Петров",
"day": 1393632000,
"begin": 36706,
"end": 67879
}]
}

itemsEmployees’ list with clock-in and clock-out times for each employee;
employee_idEmployee's ID;
first_nameEmployee's name;
second_nameEmployee's surname;
is_deletedIf an employee’s profile is deleted;
dayDay for which the statistics is returned. The day is set as the number of seconds starting from 01.01.1970 until 00:00:00 of the day;
beginClock-in time in seconds from the beginning of the day. -1 — undefined time;
endClock-out time in seconds from the beginning of the day. -1 — undefined time.