SetupGuide

Custom wildcard H1 title

This guide will lead you through installation process of Layer24 time tracking service.

  • Chapter I requirements.
  • Chapter II environment setup.
  • Chapter III application configuration.

Chapter I requirements

In order to deploy application on your server you will need the following:


Chapter II environment setup

  1. Install Java 7.

    Please make sure you have set JAVA_HOME or JRE_HOME environment variable on Windows after setup. Common path for JRE_HOME is C:\Program Files\Java\jre7.

  2. Install Apache Tomcat 7.

  3. Install MySQL official install guide.
  4. Create empty database.

    For example: mysql> CREATE SCHEMA mydatabase DEFAULT CHARACTER SET utf8;

  5. Create user.

    For example: mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass'; mysql> GRANT ALL PRIVILEGES ON mydatabase.* TO 'monty'@'localhost' WITH GRANT OPTION;

  6. Load the Time Zone Tables:

    For *nix - official documentation page.

    If your system is one that has no zoneinfo database (for example, Windows), you can use the package of pre-built time zone tables that is available for download at the MySQL Developer Zone:

    http://dev.mysql.com/downloads/timezones.html

    This time zone package contains .frm, .MYD, and .MYI files for the MyISAM time zone tables. These tables should be part of the mysql database, so you should place the files in the mysql subdirectory of your MySQL server's data directory. On Windows default location is C:\ProgramData\MySQL\MySQL Server 5.0\data\mysql.

    IMPORTANT: Correct folder is ProgramData, not Program Files. Also ProgramData folder is hidden so you need to enable appearance of hidden folders in explorer.

    The server should be stopped while you do this and restarted afterwards.

    After server restart please make sure time zones were loaded correctly. Open MySQL client terminal our other SQL execution tool and perform following query: SQL SELECT CONVERT_TZ('2014-01-01 20:00:00', 'Europe/Kiev', 'Europe/Berlin');

    If time zone data is imported correctly then you should see 2014-01-01 19:00:00 as result.

  7. Agent application can discover application server URL automatically. Make sure that port 8888 is not used on your server machine to make it work.

  8. Copy .war file to tomcat /webapp directory.
  9. Navigate to tomcat 7 /bin directory.
  10. Create setenv file:

    On Windows: setenv.bat

    On *nix: setenv.sh

    Additional information available at official documentation page

  11. Edit setenv file by adding following lines:

    for Windows

    set "CATALINA_OPTS=%CATALINA_OPTS% -XX:MaxPermSize=512m -Xms128m -Xmx1024m"
    set "JAVA_OPTS=%JAVA_OPTS% -Duser.timezone=UTC"
    

    for *nix

    #!/bin/sh
    CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=512m -Xms128m -Xmx1024m"
    JAVA_OPTS="$JAVA_OPTS -Duser.timezone=UTC"
    
  12. Start server using catalina.sh run or catalina.bat run if you are using Windows.


Chapter III screenshots displaying setup

  1. Create assets.xml file in tomcat /conf/Catalina/localhost/ directory.
  2. Edit assets.xml file by adding following line:

    For Windows XP

    <Context docBase="C:\\Documents and Settings\\%USERNAME%\\.Layer24\\assets"></Context>
    

    For Windows Vista and above:

    <Context docBase="C:\\Users\\%USERNAME%\\.Layer24\\assets"></Context>
    

    For *nix

    <Context docBase="/home/username/.Layer24/assets"></Context>
    
  3. Add above to the <Host> section in server.xml which located at /conf tomcat directory.

    <Context path="" docBase="war_file_name">
        <WatchedResource>WEB-INF/web.xml</WatchedResource>
    </Context>
    <Context path="ROOT" docBase="ROOT">
        <WatchedResource>WEB-INF/web.xml</WatchedResource>
    </Context>
    

    IMPORTANT: Instead of war_file_name you must set name of your war file (layer24 by default)


Chapter IV application configuration

  1. Use supported browser to open application index page. You will be redirected to configuration page (Default link: localhost:8080). configuration_form.png
  2. Fill all required fields.

    2.1 General Settings

    Company name Name of your company which will be used for sending e-mail
    Host name Server address which will be used for sending e-mail. Specify port if needed
    Admin E-Mail E-mail which will be used to create first administrator for the system
    Password Administrator password

    2.2 MySQL Configuration

    Host Address of database
    Port Specify port
    Database Database name
    Username Name of user which have all rights to modify data in database
    Password User password. Leave blank if none

    2.3 SMTP Configuration

    Host Address of mail server which provides service
    Port Specify port
    Domain Mail service domain
    Sender Name which will be present in e-mail sent by application. For example [email protected]
    Username Account which will be used for sending e-mail. For example [email protected]
    Password Account password
    UseSSL Whether use SSL secured connection or not

    When you finished filling all required fields of MySQL Configuration or SMTP Configuration, you can check whether configuration is correct, by clicking Check button.

  3. Confirm configuration by clicking Save Settings button. You will receive confirmation mail containing your login and password.

    If you want to change configuration afterwards, you need to complete following steps:

  • Open configuration file located at user home directory.

    For Windows XP: C:\Documents and Settings\%USERNAME%\.Layer24\database.properties

    For Windows Vista and above: C:\Users\%USERNAME%\.Layer24\database.properties

    For *nix is typically /home/username/.Layer24/database.properties

  • Modify properties and save file. Server should restart automatically in few minutes. Optionally restart server manually.

API

Layer24 API

This is a REST-style API that uses JSON for serialization and access token transmission for authentication.

Making a request

All URLs start with http://layer24.com/api/v1/. The path is prefixed with the API version. If we change the API in backward-incompatible ways, we'll bump the version marker and maintain stable support for the old URLs.

To make a request for all the projects, you'd append the projects index path to the base url to form http://layer24.com/api/v1/projects.json. In curl, that looks like:

curl -u token: http://layer24.com/api/v1/projects.json

To create something, it's the same deal except you also have to include the Content-Type header and the JSON data:

curl -u token: \
  -H 'Content-Type: application/json' \
  -d '{"name": "New company project"}' \
  http://layer24.com/api/v1/projects.json

Authentication

In order to authenticate your requests you need to provide them with access token. Reed more at Authentication page.

JSON serialization

We only support JSON for serialization of data. Our format is to have no root element and we use snake_case to describe attribute keys. This means that you have to send Content-Type: application/json when you're POSTing or PUTing data into Layer24.

Error handling

In case request was sent correctly, but during it's processing data was recognized as invalid (as with unique names validation), response will return json with corresponding message

{
    "status":422,
    "code":"INVALID_ENTITY",
    "message":"Employee has some errors",
    "errors":
        [
            {
                "code":"UNIQUE_CONSTRAINT",
                "message":"E-mail is already in use",
                "field":"email"
            }
        ]
}

Available API

Layer24 API Authentication

Most API requests must be authenticated with access token passed via HTTP Basic Authentication as user name. For example curl -u token: http://layer24.com/api/v1/projects.json where token is an access token you have got before.

Getting access token

In order to get access token you should send your email and password to special API endpoint. In response your will get access token. Please note: access tokens expire ONLY when you change password.

Example request to get access token

curl \
  -H 'Content-Type: application/json' \
  -d '{"email": "[email protected]", "password": "secret"}' \
  http://layer24.com/api/v1/users/login

Example response

{
   "result" : {
      "email" : "[email protected]",
      "status" : "OK",
      "token" : "fece2a5a67bcf1ee5acc9d7a85c1b107"
   }
}

Content of token field from above response example should be provided with other requests via HTTP Basic Authentication as user name.

curl -u fece2a5a67bcf1ee5acc9d7a85c1b107: \
  http://layer24.com/api/v1/projects.json

One time access token

How to obtain one time access token

For authenticated user system can provide one time access token for automatic authentication in another browser session for example.

Example request to get one time access token

curl -u fece2a5a67bcf1ee5acc9d7a85c1b107: \
  http://layer24.com/api/v1/user/one_time_token

Example response

{
    "token": "bb7f102f-a671-4f4b-8c15-3a657a824faf"
}

Projects

Get projects

  • GET /projects.json will return all projects. Where team is the number of employees assigned to project.

    [
       {
          "id":1,
          "name":"Angular",
          "team":5,
          "is_archive":false
       },
       {
          "id":3,
          "name":"Grunt",
          "team":5,
          "is_archive":true
       }
    ]
    

Get project

  • GET /projects/3.json will return the specified project. Where team is the number of employees assigned to project.

    {
      "id":3,
      "name":"Grunt",
      "team":5,
      "is_archive":true
    }
    

Create project

  • POST /projects.json will create a new projects from the parameters passed.

    {
      "name":"New project"
    }
    

    This will return 201 Created with the current JSON representation of the project if the creation was a success. See the Get project endpoint for more info.

Update project

  • PUT /projects/1.json will update the project from the parameters passed.

    {
      "name":"This is a new name for the project"
    }
    

    This will return 204 No content if the update was a success.

Deactivating/activating a project

  • PUT /projects/1.json with the following JSON payload will deactivate a project (pass false to activate it again).

    {
      "is_archive":true
    }
    

    This will return 204 No content if the update was a success.

Employees

Get employees

  • GET /employees.json will return all employees.

    [
       {
          "id":1,
          "first_name":"John",
          "last_name":"Smith",
          "email":"[email protected]",
          "role":"admin",
          "language":"en",
          "time_zone":"America/Denver",
          "week_start":0,
          "is_archive":false,
          "productivity_group":
          {
             "id":1,
             "name":"default",
             "is_default":true
          }
       },
       {
          "id":2,
          "first_name":"Jane",
          "last_name":"Smith",
          "email":"[email protected]",
          "role":"employee",
          "language":"en",
          "time_zone":"America/Denver",
          "week_start":0,
          "is_archive":true,
          "productivity_group":
          {
             "id":2,
             "name":"Developer",
             "is_default":false
          }
       }
    ]
    

Get user projects

  • GET /employees/1/projects will return all projects assigned to user whose id passed in url.

    [
        {
            "id":12,
            "name":"Grand project",
            "team":3,
            "is_archive":"false"
        }
    ]
    

    This will return Status 200 OK on success.

Create employee

  • POST /employees.json will create a new employee from the parameters passed.

    {
      "first_name":"Jane",
      "last_name":"Smith",
      "email":"[email protected]",
      "password":"secret",
      "role":"employee",
      "language":"en",
      "week_start":0,
      "time_zone":"America/Denver",
      "group_id":2
    }
    

    This will return 201 Created with the current JSON representation of the employee if the creation was a success. See the Get employee endpoint for more info.

Update employee

  • PUT /employees/2.json will update the employee from the parameters passed.

    {
      "id":2,
      "first_name":"Jane",
      "last_name":"Lawrence",
      "email":"[email protected]",
      "role":"employee",
      "language":"en",
      "week_start":0,
      "time_zone":"America/Denver",
      "group_id":2,
      "is_archive":false
    }
    

    This will return 200 OK with the current JSON representation of the employee if the update was a success. See the Get employee endpoint for more info.

Archiving employees

  • PUT /employees/archive.json will archive employees from the parameters passed.

    {
      "ids":[142]
    }
    

    This will return 204 No content if the update was a success.

Activating employees

  • PUT /employees/activate.json will activate employees from the parameters passed.

    {
      "ids":[142, 152]
    }
    

    This will return 204 No content if the update was a success.

Change password for employee

  • PUT /employees/2.json will update password from the parameters passed.

    {
      "password":"secret"
    }
    

    This will return 204 No content if the update was a success.

Layer24 API Productivity Groups

Get Productivity Groups

  • GET /productivity_groups.json will return Status 200 OK and all prodoctivity groups.

    [
        {
            "id":1,
            "name":"default",
            "is_default":true
        },           
        {
            "id":3,
            "name":"Developer",
            "is_default":false
        }
    ]
    

Create new Productivity group

  • POST /productivity_groups.json will create new productivity group from passed name

    {
        "name":"newGroup"
    }
    

    This will return 200 OK with the current JSON representation of the employee if the creation was a success

    {
        "id":83,
        "name":"newGroup",
        "is_default":false
    }
    

Edit Productivity group

  • PUT /productivity_groups/3.json will update productivity group with id passed in url and date passed in json

    {
        "name":"Developer"
    }
    

Delete Productivity Groups

  • DELETE /productivity_groups.json?ids[]=83&ids[]=84 will delete multiple productivity groups. Parameter ids contains ids of productivity groups to be deleted. Response will return Status 204 No Content on successful operation.
  • DELETE /productivity_groups/1 will delete single productivity group with id passed in url. Response will return Status 204 No Content on successful operation.

Categories

Get Productivity group categorization

  • GET /categories/8.json will return categories with productivity settings for each category inside productivity group. Productivity group id passed in url. Response returns status 200 OK and data in json if operation was successful.

    [
        {
            "id":1,
            "name":"default",
            "productivity":1,
            "is_default":true
        },
        {
            "id":3,
            "name":"Multimedia",
            "productivity":1,
            "is_default":false
        }
    ]
    

Create category

  • POST http://localhost:8080/api/v1/categories?productivity_group=8 will create new category with name passed inside json. Productivity settings will be applied for productivity group with id passed in url parameter.

    {
        "productivity":1,
        "name":"new Category"
    }
    

    Response returns Status 201 Created with the current json representation of the created category if operation was successful.

    {
        "id":46,
        "name":"new Category",
        "productivity":1,
        "is_default":false
    }
    

Edit category

  • PUT /categories/8.json will update existing category with passed json. Productivity settings will be updated for productivity group with id passed in url.

    {
        "category":
            {
                "id":46,
                "name":"Utilities",
                "productivity":1
            }
    }
    

    Response returns Status 204 No Content if operation was successful.

Delete category

  • DELETE /categories/46 will delete category with id passed in url. Response returns Status 200 OK if operation was successful.

Applications

Move application

  • POST /applications/move.json?update_activities=false will move the applications with given ids to category in parameters passed.

    {
      "ids":[1],
      "category_id":2
    }
    

    This will return Status 200 OK if application was moved.

Get applications of category

  • GET /applications?category_id=3&productivity_group_id=1 will return all applications inside category with productivity settings dictated by productivity group.

    [
        {
            "id":164,
            "name":"Notepad",
            "productivity":10,
            "is_document":false,
            "category_id":3,
            "groupId":1,
            "tracked":32460
         }
    ]
    

    This will return Status 200 OK if operation was successful.

Change application productivity

  • POST /applications/productivity.json will change application productivity settings for productivity group passed in json

    {
        "group_id":"1",
        "application_id":38,
        "productivity":0
    }
    

    This will return Status 200 OK if operation was successful.

Offline time

Get offline time

  • GET /offline_activities.json?from_date=2014-06-11T00:00:00.000Z&to_date=2014-06-11T23:59:59.000Z will return all offline time that located in range which is passed as parameters in request. Adjusted duration displayed in seconds. Response will return Status 200 OK if operation was successful. Passed time interpreted as time in time zone of logged in user.

    [
        {
            "id":396,
            "description":"description",
            "user_id":4,
            "adjusted_duration":10800,
            "project_id":16,
            "project_name":"GIS",
            "end_at":"2014-06-11T12:00:00.000",
            "start_at":"2014-06-11T09:00:00.000"
         }
    ]
    

Create offline time

  • POST /offline_activities/4.json will create offline time for user with id passed in url and data passed in json. Adjusted duration displayed in seconds. Passed time interpreted as time in time zone of logged in user.

    {
        "project_id":16,
        "adjusted_duration":10800,
        "description":"description",
        "start_at":"2014-06-11T09:00:00.000",
        "end_at":"2014-06-11T12:00:00.000"
    }
    

    Response will return representation of newly created offline time and Status 201 Created if operation was successful.

    {
        "id":396,
        "description":"description",
        "user_id":4,
        "adjusted_duration":10800,
        "project_id":16,
        "project_name":"GIS",
        "end_at":"2014-06-11T12:00:00.000",
        "start_at":"2014-06-11T09:00:00.000"
    }
    

Edit offline time

  • PUT /offline_activities/396.json will update offline time with id passed in url and data passed in json. Adjusted duration displayed in seconds. Passed time interpreted as time in time zone of logged in user.

    {
        "description":"new description",
        "project_id":16,
        "adjusted_duration":14400,
        "start_at":"2014-06-11T09:00:00.000",
        "end_at":"2014-06-11T13:00:00.000"
    }
    

    Successful operation will return status 204 No Content.

Delete offline time

  • DELETE /offline_activities/396.json will delete offline activity with id passed in url. Successful operation will return status 204 No Content.
  • POST /offline_activities/bulkDelete.json will delete multiple offline activities with ids passed in json.

    [397,398]
    

    Successful operation will return status 200 OK.

Reports

JSON structure

  • Bellow in this document you may find JSONPath notation used to explain purpose of some properties in JSON request/response payload. Take a look at below JSON response.

    {
        "employees":
            [
                {
                    "id":4,
                    "projects":[3],
                    "first_name":"John",
                    "last_name":"Smith"
                }
             ],
         "projects":
             [
                 {
                     "employees":[4],
                     "id":3,
                     "name":"Grunt",
                     "is_default":false
                 }
              ]
    }
    

    With JSONPath employees property may be referenced as $.employees. Id of an employee in a list may be referenced as $.employees[*].id.

Get Active projects and users

  • POST /report/users/active/by_period.json will return list of project and users for period passed in json. Passed time interpreted as time in time zone of logged in user.

    {
        "period":
            {
                "from_date":"2014-05-01T00:00:00.000Z",
                "to_date":"2014-05-31T23:59:59.000Z"
            }
    }
    

    Successful operation will return status 200 OK and data in json.

    {
        "employees":
            [
                {
                    "id":4,
                    "projects":[3],
                    "first_name":"John",
                    "last_name":"Smith"
                }
             ],
         "projects":
             [
                 {
                     "employees":[4],
                     "id":3,
                     "name":"Grunt",
                     "is_default":false
                 }
              ]
    }
    

Get report by employee

  • POST /productivity/by_employee.json will return productivity data for period, employees, projects and categories passed in json. Project, employee and category ids are optional. Passed time interpreted as time in time zone of logged in user.

    {
        "period":
            {
                "from_date":"2014-05-01T00:00:00.000Z",
                "to_date":"2014-05-31T23:59:59.000Z"
            },
        "project_ids":[9],
        "employee_ids":[137],
        "category_ids":[2]
    }
    

    Response will return status 200 OK and data in json on successful operation.

    {
        "status":"OK",
        "users":
            [
                {
                    "first_name":"John",
                    "last_name":"Smith",
                    "id":137,
                    "last_30_days_activities":[0,0,0,0,0,0,0,0,0,0,0,0,0,250,341,0,0,243,220,470,247,98,0,0,57,0,0,0,0,0],
                    "neutral_min":1361,
                    "offline_min":0,
                    "productive_min":565,
                    "total_min":1928,
                    "unproductive_min":2
                }
            ]
    }
    

Get report by project

  • POST /productivity/by_project.json will return productivity data for period, employees, projects and categories passed in json. Project, employee and category ids are optional. Passed time interpreted as time in time zone of logged in user.

    {
        "period":
            {
                "from_date":"2014-05-01T00:00:00.000Z",
                "to_date":"2014-05-31T23:59:59.000Z"
            },
        "project_ids":[9],
        "employee_ids":[137],
        "category_ids":[2]
    }
    

    Response will return status 200 OK and data in json on successful operation.

    {
        "status":"OK",
        "projects":
        [
            {
                "is_default":true,
                "name":"default",
                "id":9,
                "last_30_days_activities":[0,0,0,0,0,0,0,0,0,0,0,0,0,250,341,0,0,243,220,470,247,98,0,0,57,0,0,0,0,0],
                "neutral_min":1361,
                "offline_min":0,
                "productive_min":565,
                "total_min":1928,
                "unproductive_min":2
            }
        ]
    }
    

Get report by date

  • POST /productivity/by_date.json will return productivity data for period, employees, projects and categories passed in json. Project, employee and category ids are optional. Passed time interpreted as time in time zone of logged in user.

    {
        "period":
            {
                "from_date":"2014-05-01T00:00:00.000Z",
                "to_date":"2014-05-31T23:59:59.000Z"
            },
        "project_ids":[9],
        "employee_ids":[137],
        "category_ids":[2]
    }
    

    Response will return status 200 OK and data in json on successful operation.

    {
        "status":"OK",
        "dates":
            [
                {                
                    "activity_day":"2014-05-23",
                    "neutral_min":98,
                    "offline_min":0,
                    "productive_min":0,
                    "total_min":98,
                    "unproductive_min":0
                }
            ]
    }
    

Get report by category

  • POST /productivity/by_category.json will return productivity for period, employees, project and categories passed in json. Project, employee and category ids are optional. Passed time interpreted as time in time zone of logged in user.

    {
        "period":
            {
                "from_date":"2014-05-01T00:00:00.000Z",
                "to_date":"2014-05-31T23:59:59.000Z"
            },
        "project_ids":[9],
        "employee_ids":[137],
        "category_ids":[2]
    }
    

    Response will return status 200 OK and data in json on successful operation.

    {
        "status":"OK",
        "categories":
            [
               {
                    "is_default":true,
                    "offline_min":0,
                    "name":"default",
                    "productive_min":60,
                    "id":1,
                    "total_min":60,
                    "last_30_days_activities":null,
                    "neutral_min":0,
                    "unproductive_min":0
                },
                {
                    "is_default":false,
                    "offline_min":134,
                    "name":"Games",
                    "productive_min":324,
                    "id":26,
                    "total_min":515,
                    "last_30_days_activities":null,
                    "neutral_min":34,
                    "unproductive_min":23
                }
            ]
    }
    

Get report by application

  • POST /productivity/by_application.json will return productivity for period, employees, project and categories passed in json. Project, employee and category ids are optional. Passed time interpreted as time in time zone of logged in user.

    {
        "period":
        {
            "from_date":"2014-05-01T00:00:00.000Z",
            "to_date":"2014-05-31T23:59:59.000Z"
        },
        "project_ids":[9],
        "employee_ids":[137],
        "category_ids":[2]
    }
    

    Response will return status 200 OK and data in json on successful operation.

    {
        "status":"OK",
        "applications":
            [
                {
                    "offline_min":0,
                    "name":"google-chrome-stable",
                    "productive_min":0,
                    "id":21,
                    "total_min":194,
                    "last_30_days_activities":null,
                    "neutral_min":194,
                    "unproductive_min":0
                },
                {
                    "offline_min":0,
                    "name":"gnome-terminal",
                    "productive_min":0,
                    "id":22,
                    "total_min":39,
                    "last_30_days_activities":null,
                    "neutral_min":0,
                    "unproductive_min":39
                }
            ]
    }
    

Get productivity for Gantt chart

  • POST /productivity/daily_by_employee.json will return productivity and activities for gantt chart by period, employees, project and categories passed in json. Project, employee and category ids are optional. Passed time interpreted as time in time zone of logged in user.

    {
       "period":
          {
             "from_date":"2015-01-06T00:00:00.000Z",
             "to_date":"2015-01-06T23:59:59.000Z"
          },
          "project_ids":[9],
          "employee_ids":[11],
          "category_ids":[1]
    }
    

    Response will return data in json on successful operation.

    {
       "applications":
          {
             "32":"gnome-nautilus"
          },
       "productivities":
          [
             {
                "activities":
                   [
                      {
                         "duration":3,
                         "start_time":540,
                         "end_time":547,
                         "productivity_type":1,
                         "productive_duration":0,
                         "neutral_duration":218,
                         "unproductive_duration":0,
                         "applications":
                            [
                               {
                                  "duration":144,
                                  "application_id":32
                               }
                            ]
                      }
                   ],
                "activity_day":"2015-01-06",
                "clockOffDateTime":1420539780000,
                "clockOnDateTime":1420534304000,
                "clock_off_time":623,
                "clock_on_time":531,
                "last_30_days_activities":null,
                "id":11,
                "first_name":"John",
                "last_name":"Smith",
                "neutral_min":1,
                "productive_min":0,
                "unproductive_min":0,
                "offline_min":6,
                "total_min":7,
                "offline_times":
                   [
                      {
                         "description":"description",
                         "duration":6,
                         "end_time":610,
                         "start_time":604
                      }
                   ]
             }
          ]
    }
    
    • $.applications - map of applications used during specified period where key is applications id and value is application name.
    • $.productivities - list of employee activities grouped by employee and date.
    • $.productivities[*].activities - list of online activities grouped in blocks.
    • $.productivities[*].activities[*].duration,
      $.productivities[*].activities[*].productive_duration,
      $.productivities[*].activities[*].neutral_duration,
      $.productivities[*].activities[*].unproductive_duration - block duration in minutes.
    • $.productivities[*].activities[*].start_time - block start time in minutes from midnight. For example block starting at 09:30 will be presented as 570 minutes.
    • $.productivities[*].activities[*].end_time - block end time in minutes from midnight.
    • $.productivities[*].activities[*].applications - list of applications with dominant productivity type included in block. Top 5 applications order descending by duration.
    • $.productivities[*].activities[*].applications[*].duration - time spent in application within activity block in seconds.
    • $.productivities[*].activities[*].applications[*].application_id - application id, used as a key in $.applications
    • $.productivities[*].activities[*].activity_day - day when activity was tracked.
    • $.productivities[*].activities[*].clock_on_time - time when employee started activity tracking that day in minutes from midnight.
    • $.productivities[*].activities[*].clock_off_time - time when employee ended activity tracking that day in minutes from midnight.
    • $.productivities[*].offline_times - list of offline activities.
    • $.productivities[*].offline_times[*].duration - offline activity duration in minutes.
    • $.productivities[*].offline_times[*].start_time - offline activity start time in minutes from midnight.
    • $.productivities[*].offline_times[*].end_time - offline activity end time in minutes from midnight.

Get work log

  • POST /productivity/work-log.json will return activities for period, employees, projects, categories and productivity type passed in json. Project ids, employee ids and productivity type are optional. Passed time interpreted as time in time zone of logged in user.

    {
        "period":
            {
                "from_date":"2014-05-15T00:00:00.000Z",
                "to_date":"2014-05-15T23:59:59.000Z"
            },
        "project_ids":[9],
        "employee_ids":[137],
        "category_ids":[2],
        "productivity_type":"productive"
    }
    

    Response will return status 200 OK and data in json on successful operation. Duration displayed in seconds.

    [
        {
            "id":54500,
            "duration":98,
            "app_name":"layer24",
            "user_firstName":"John",
            "user_lastName":"Smith",
            "project_name":"default",
            "project_isDefault":true,
            "category_name":"default",
            "category_isDefault":true,
            "productivity_type":0,
            "time_start":"2014-06-11T08:53:58"
        }
    ]
    

Get activity by period

  • POST /report/summary/activity_by_period.json will return dates which have activities that satisfy criteria passed in json. Project ids, employee ids, category ids, activity type, productivity type are optional. Passed time interpreted as time in time zone of logged in user.

    {
        "period":
        {
            "from_date":"2014-03-01T00:00:00.000Z",
            "to_date":"2014-04-30T23:59:59.000Z"
        },
        "project_ids":[9],
        "employee_ids":[137],
        "category_ids":[2],
        "activity_type":null,
        "productivity_type":"productive"
    }
    

    Response will return status 200 OK and data in json on successful operation.

    {
        "result":        
        {
            "2014-05-22":true,
            "2014-05-23":true,
            "2014-05-20":true,
            "2014-05-21":true,
            "2014-05-19":true,
            "2014-05-16":true,
            "2014-05-15":true,
            "2014-05-26":true
        },
        "status":"OK"
    }
    

Screenshots

Get screenshots

  • POST /screenshots/activity.json will return list of screenshots for period passed in json. Passed time interpreted as time in time zone of logged in user.

    {
        "period":
            {
                "from_date":"2014-05-01T00:00:00.000Z",
                "to_date":"2014-05-31T23:59:59.000Z"
            }
    }
    

    Successful operation will return status 200 OK and data in json.

    [
        {
            "id":1,
            "app_name":"skype",
            "duration":63,
            "time_start":"2015-05-01T17:23:25",
            "productivity_type":1,
            "category_name":"Communication",
            "category_isDefault":false,
            "project_name":"Grunt",
            "project_isDefault":false,
            "is_archive":false,
            "user_firstName":"John",
            "user_lastName":"Smith",
            "sn_id":"20150501172225654",
            "displays":"A"
        }
    ]
    
    • sn_id - snapshot identifier.
    • displays - displays quantity (A - 1, B - 2).