Time Entries API

List time entries

List all time entries for an account:

GET /time_entries

Response

Status: 200 OK
[
  {
    "id": 195,
    "date": "2016-03-28",
    "correction": false,
    "created_at": "2016-03-28T12:13:11-05:00",
    "updated_at": "2016-03-28T12:13:11-05:00",
    "time_spent": 120,
    "organization": {
      "id": 7,
      "name": "Widget North America, Information Technology"
    },
    "person": {
      "id": 7,
      "name": "Chess Cole"
    },
    "time_allocation": {
      "id": 4,
      "group": "Project",
      "name": "Transparency of Performance (TOP)",
      "account": {
        "id": "wna-it",
        "name": "Widget N. America - IT"
      },
      "localized_group": "Project",
      "localized_name": "Transparency of Performance (TOP)"
    },
    "service": {
      "id": 36,
      "name": "SAP Basis",
      "localized_name": "SAP Basis"
    },
    "customer": {
      "id": 8,
      "name": "Widget North America, Human Resources"
    },
    "description": "Transaction response time testing for new HR features."
  },
  {
    "id": 231,
    "date": "2016-03-28",
    "created_at": "2016-03-28T14:55:00-05:00",
    "updated_at": "2016-03-28T14:57:00-05:00",
    "time_spent": 10,
    "organization": {
      "id": 44,
      "name": "Widget Data Center, External IT"
    },
    "person": {
      "id": 57,
      "name": "Tom Waters"
    },
    "request": {
      "id": 70248,
      "subject": "Expense reporting is slow",
      "account": {
        "id": "wna-it",
        "name": "Widget N. America - IT"
      },
      "service": {
        "id": 22,
        "name": "Expense Reporting",
        "localized_name": "Expense Reporting"
      },
      "customer": {
        "id": 48,
        "name": "Widget North America, Sales & Marketing"
      }
    }
  },
  "..."
]

The response contains these fields by default. Filtering and pagination are available to reduce/limit the collection of time entries.

Collection Fields

By default the following fields will appear in collections of time entries:

id date time_spent person request (only when available) problem (only when available) task (only when available) project_task (only when available) time_allocation (only when available) service customer organization description deleted created_at updated_at

Obtain a different set of fields using the ?fields= parameter.

Note that the problem, request, task and project_task fields cannot be specified using the ?fields= parameter. These fields will appear when the time_allocation field is specified.

Sorting

By default a collection of time entries is sorted ascending by id.

The following fields are accepted by the ?sort= parameter:

id date created_at updated_at

Get a single time entry

GET /time_entries/:id

Response

Status: 200 OK
{
  "id": 195,
  "date": "2016-03-28",
  "deleted": false,
  "correction": false,
  "created_at": "2016-03-28T12:13:11-05:00",
  "updated_at": "2016-03-28T12:13:11-05:00",
  "time_spent": 120,
  "organization": {
    "id": 7,
    "name": "Widget North America, Information Technology"
  },
  "person": {
    "id": 7,
    "name": "Chess Cole"
  },
  "time_allocation": {
    "id": 4,
    "group": "Project",
    "name": "Transparency of Performance (TOP)",
    "account": {
      "id": "wna-it",
      "name": "Widget N. America - IT"
    },
    "localized_group": "Project",
    "localized_name": "Transparency of Performance (TOP)"
  },
  "service": {
    "id": 36,
    "name": "SAP Basis",
    "localized_name": "SAP Basis"
  },
  "customer": {
    "id": 8,
    "name": "Widget North America, Human Resources"
  },
  "description": "Transaction response time testing for new HR features."
}

The response contains these fields.

Create a time entry

POST /time_entries

When creating a new time entry these fields are available.

Response

Status: 201 Created
{
  "coverage": "...",
  "...": "..."
}

The response contains all fields of the created time entry and is similar to the response in Get a single time entry

Update a time entry

PATCH /time_entries/:id

When updating a time entry these fields are available.

Response

Status: 200 OK
{
  "date": "...",
  "...": "..."
}

The response contains all fields of the updated time entry and is similar to the response in Get a single time entry

Remove a time entry

Remove a time entry with a specific ID.

DELETE /time_entries/:id

Response

Status: 204 No Content

Fields

correction
Optional boolean, default: false — The Correction box is checked when the time entry should be considered a correction for a time entry that was registered for a date that has already been locked.
created_at
Readonly datetime — The date and time at which the time entry was created.
customer
Required reference to Organization — The Customer field is used to select the organization for which the time was spent.
date
Required date — The Date field is used to select the date on which the time was spent.
deleted
Optional boolean, default: false — The Deleted box is automatically checked after the time entry has been deleted. The data of a deleted time entry that is older than 3 months can no longer be retrieved.
description
Required string (max 80) — The Description field is used to enter a short description of the time spent. This field is available and required only when the Description required box is checked in the selected time allocation.
id
Readonly integer — The unique ID of the time entry.
organization
Readonly reference to Organization — The organization to which the person was linked when the time entry was created.
person
Required reference to Person — The Person field is used to specify the person who spent the time.
problem
Readonly reference to Problem — The Problem field shows the problem in which the Time spent field was filled out to cause the time entry to be generated.
request
Readonly reference to Request — The Request field shows the request in which the Time spent field was filled out to cause the time entry to be generated.
service
Required reference to Service — The Service field is used to select the service for which the time was spent.
task
Readonly reference to Task — The Task field shows the task in which the Time spent field was filled out to cause the time entry to be generated.
time_allocation
Required reference to Time Allocation — The Time allocation field is used to select the time allocation on which the time was spent. Only the time allocations that are linked to the person’s organization can be selected.
time_spent
Required integer, — The Time spent field is used to specify the number of minutes that was spent on the selected time allocation. The number of minutes is allowed to be negative only when the correction field is set to true.
updated_at
Readonly datetime — The date and time of the last update of the time entry. If the time entry has no updates it contains the created_at value.