Toggle Sidebar

Reports

This section describes how to use the API's analytics and reporting services. All reports (user, projects, clients, etc) share this common JSON model. At the bottom of this page you'll find the specifications for the User Report.

Attributes

Type Attribute Description Required
Object metadata The report description. See Metadata Read only
Array charts Data to generate report charts. See Chart Read only
Array reports Report data. See User Report Read only

Report Object

Use JSON Visualization to get a better picture of the model.

{
  "response": {
    "status": 200,
    "message": "Request completed successfully"
  },
  "data": {
    "metadata": {
      "type": "USER_REPORT",
      "name": "Employee Time Report",
      "description": "This report shows you time spent across all your team members.",
      "created_at": "2014-12-11 13:21:19"
    },
    "charts": [
      {
        "metadata": {
          "type": "BAR_CHART",
          "name": "Hours by User"
        },
        "data": [
          {
            "hours": 198.98,
            "name": "Diego",
            "surname": "Wyllie",
            "id": 1
          }
        ]
      },
      {
        "metadata": {
          "type": "BAR_CHART",
          "name": "User by Customer"
        },
        "data": [
          {
            "hours": 88.58,
            "users": [
              {
                "hours": 88.58,
                "name": "Diego",
                "surname": "Wyllie",
                "id": 1
              }
            ],
            "name": "Tracking Time, LLC",
            "total_projects": 0,
            "archived_projects": 0,
            "active_projects": 0,
            "id": 5329
          },
          {
            "hours": 7.22,
            "users": [
              {
                "hours": 7.22,
                "name": "Diego",
                "surname": "Wyllie",
                "id": 1
              }
            ],
            "name": "Muen Solutions",
            "total_projects": 0,
            "archived_projects": 0,
            "active_projects": 0,
            "id": 39
          }
        ]
      },
      {
        "metadata": {
          "type": "BAR_CHART",
          "name": "User by Project"
        },
        "data": [
          {
            "hours": 88.58,
            "users": [
              {
                "hours": 88.58,
                "name": "Diego",
                "surname": "Wyllie",
                "id": 1
              }
            ],
            "is_archived": false,
            "following": false,
            "name": "Tracking Time v2",
            "id": 5348
          },
          {
            "hours": 7.22,
            "users": [
              {
                "hours": 7.22,
                "name": "Diego",
                "surname": "Wyllie",
                "id": 1
              }
            ],
            "is_archived": false,
            "following": false,
            "name": "Office 2014",
            "id": 7310
          }
        ]
      }
    ],
    "reports": [
      {
        "clients": [
          {
            "hours": 88.58,
            "projects": [
              {
                "hours": 88.58,
                "project_tasks": [
                  {
                    "hours": 20.22,
                    "name": "Management",
                    "priority": 0,
                    "is_archived": false,
                    "list_position": 0,
                    "now_tracking": false,
                    "id": 19667
                  },
                  {
                    "hours": 54.72,
                    "name": "iPhone App",
                    "priority": 0,
                    "is_archived": false,
                    "list_position": 0,
                    "now_tracking": false,
                    "id": 19923
                  },
                  {
                    "hours": 3.05,
                    "name": "API",
                    "priority": 0,
                    "is_archived": false,
                    "list_position": 0,
                    "now_tracking": false,
                    "id": 19713
                  },
                  {
                    "hours": 10.59,
                    "name": "Implement User Reports",
                    "priority": 0,
                    "is_archived": false,
                    "list_position": 0,
                    "now_tracking": false,
                    "id": 20215
                  }
                ],
                "is_archived": false,
                "following": false,
                "name": "Tracking Time v2",
                "id": 5348
              }
            ],
            "name": "Tracking Time, LLC",
            "total_projects": 0,
            "archived_projects": 0,
            "active_projects": 0,
            "id": 5329
          },
          {
            "hours": 7.22,
            "projects": [
              {
                "hours": 7.22,
                "project_tasks": [
                  {
                    "hours": 7.22,
                    "name": "Office",
                    "priority": 0,
                    "is_archived": false,
                    "list_position": 0,
                    "now_tracking": false,
                    "id": 19921
                  }
                ],
                "is_archived": false,
                "following": false,
                "name": "Office 2014",
                "id": 7310
              }
            ],
            "name": "Muen Solutions",
            "total_projects": 0,
            "archived_projects": 0,
            "active_projects": 0,
            "id": 39
          }
        ],
        "hours": 198.97,
        "name": "Diego",
        "surname": "Wyllie",
        "id": 1
      }
    ]
  }
}
                                    

Metadata

Reports and charts are depicted by metadata objects.

Attributes

Type Attribute Description Required
String type USER_REPORT Read only
String name Report name. Read only
String description Report purpose. Read only
String created_at Report date. ISO 8601 format. Read only

Metadata Object

{
  "metadata":
  {
    "type": "USER_REPORT",
    "name": "Employee Time Report",
    "description": "This report shows you time spent across all your team members.",
    "created_at": "2014-12-11 13:21:19"
  }
}
                                    

Chart

Reports are represented by charts.

Attributes

Type Attribute Description Required
Object metadata Report description. See Metadata Read only
Array data Report charts. Read only

Chart object

{
  "charts": [
    {
      "metadata": {
        "type": "BAR_CHART",
        "name": "Hours by User"
      },
      "data": [
        {
          "hours": 198.98,
          "name": "Diego",
          "surname": "Wyllie",
          "id": 1
        }
      ]
    },
    {
      "metadata": {
        "type": "BAR_CHART",
        "name": "User by Customer"
      },
      "data": [
        {
          "hours": 88.58,
          "users": [
            {
              "hours": 88.58,
              "name": "Diego",
              "surname": "Wyllie",
              "id": 1
            }
          ],
          "name": "Tracking Time, LLC",
          "total_projects": 0,
          "archived_projects": 0,
          "active_projects": 0,
          "id": 5329
        },
        {
          "hours": 7.22,
          "users": [
            {
              "hours": 7.22,
              "name": "Diego",
              "surname": "Wyllie",
              "id": 1
            }
          ],
          "name": "Muen Solutions",
          "total_projects": 0,
          "archived_projects": 0,
          "active_projects": 0,
          "id": 39
        }
      ]
    },
    {
      "metadata": {
        "type": "BAR_CHART",
        "name": "User by Project"
      },
      "data": [
        {
          "hours": 88.58,
          "users": [
            {
              "hours": 88.58,
              "name": "Diego",
              "surname": "Wyllie",
              "id": 1
            }
          ],
          "is_archived": false,
          "following": false,
          "name": "Tracking Time v2",
          "id": 5348
        },
        {
          "hours": 7.22,
          "users": [
            {
              "hours": 7.22,
              "name": "Diego",
              "surname": "Wyllie",
              "id": 1
            }
          ],
          "is_archived": false,
          "following": false,
          "name": "Office 2014",
          "id": 7310
        }
      ]
    }
  ]
}
                                    

User report

This report helps you analyze time spent by employees in a given time period. If you don't specify a user id all users will be retrieved, according to the passed filter parameter.

Action URL

GET reports/users/[:id]

Parameters

Type Attribute Description Required
Date from The start date YES
Date to The end date YES
String sort_by [NAME | WORKED_HOURS]. Default = NAME NO
String filter [ALL | ACTIVE | ARCHIVED]. Default = ACTIVE NO

Permissions

  • Only admins and project managers can create user reports

Response Data

User Data

Type Attribute Description
String name User name, client name, project name or task name. Read only
String surname User surname Read only
Array clients User clients. Read only
Array projects Client projects. Read only
Array project_tasks Project tasks. Read only
Date hours Worked hours in the selected time period of the user, client, project or task.

User Report Object.

{
    "reports": [
      {
        "clients": [
          {
            "hours": 88.58,
            "projects": [
              {
                "hours": 88.58,
                "project_tasks": [
                  {
                    "hours": 20.22,
                    "name": "Management",
                    "priority": 0,
                    "is_archived": false,
                    "list_position": 0,
                    "now_tracking": false,
                    "id": 19667
                  },
                  {
                    "hours": 54.72,
                    "name": "iPhone App",
                    "priority": 0,
                    "is_archived": false,
                    "list_position": 0,
                    "now_tracking": false,
                    "id": 19923
                  },
                  {
                    "hours": 3.05,
                    "name": "API",
                    "priority": 0,
                    "is_archived": false,
                    "list_position": 0,
                    "now_tracking": false,
                    "id": 19713
                  },
                  {
                    "hours": 10.59,
                    "name": "Implement User Reports",
                    "priority": 0,
                    "is_archived": false,
                    "list_position": 0,
                    "now_tracking": false,
                    "id": 20215
                  }
                ],
                "is_archived": false,
                "following": false,
                "name": "Tracking Time v2",
                "id": 5348
              }
            ],
            "name": "Tracking Time, LLC",
            "total_projects": 0,
            "archived_projects": 0,
            "active_projects": 0,
            "id": 5329
          },
          {
            "hours": 7.22,
            "projects": [
              {
                "hours": 7.22,
                "project_tasks": [
                  {
                    "hours": 7.22,
                    "name": "Office",
                    "priority": 0,
                    "is_archived": false,
                    "list_position": 0,
                    "now_tracking": false,
                    "id": 19921
                  }
                ],
                "is_archived": false,
                "following": false,
                "name": "Office 2014",
                "id": 7310
              }
            ],
            "name": "Muen Solutions",
            "total_projects": 0,
            "archived_projects": 0,
            "active_projects": 0,
            "id": 39
          }
        ],
        "hours": 198.97,
        "name": "Diego",
        "surname": "Wyllie",
        "id": 1
      }
}