Time Entries

Manage time entries in TeamPulse.

GET /timeentries/{id} - Get time entry by ID

GET /timeentries - Get all time entries for the projects for which the user has access to.

GET /tasks/{taskId}/timeentries - Get time entries for a specific task.

POST /timeentries - Create a time entry

PUT /timeentries/{id} - Update a time entry

DELETE /timeentries/{id} - Delete a time entry

Time Entry Model

The object representing a time entry has the following properties:

id: integer (Read-only) - ID of the time entry.

date: DateTime (Required) - The date for which work hours are entered.

hours: float (Required) - The work hours to be entered.

type: float (Required) - The type of time entry. Should be an existing type from the list specified in Settings -> -> Time Tracking -> Work Types. Read more how to get the available time entry types for a project

userId: int (Required, Read-Only) - The ID of the user who worked the hours.

taskId: int (Required, Read-Only) - The ID of the task to which the working hours are added.

note: string - A note regarding the entered working hours.

week: int - The week in which the hours are entered based on the 'date' value.

createdBy: string - The name of the user who created the time entry.

createdAt: DateTime - The date when the time entry is created.

lastModifiedBy: string - The name of the user who last modified the time entry.

lastModifiedAt: DateTime - The date when the time entry is last modified.

Resource Url

To make API requests use the URL [teampulse]/api/v1 where [teampulse] is the URL to the TeamPulse instance which you want to manage via the API.

Example:
[teampulse]/api/v1/timeentries

Get a time entry

GET /timeentries/{id}

Response

HTTP/1.1 200

{
   "id": 1,
   "date": "2013-10-02",
   "hours": 6,
   "type": "Billable",
   "userId": 1,
   "taskId": 10,
   "note": "Api for time entries",
   "week": 40,
   "createdBy": "Paul Smith",
   "createdAt": "2013-06-06T00:00:00",
   "lastModifiedBy": "Paul Smith",
   "lastModifiedAt": "2013-10-09T13:57:28.33"
}

Get time entries

GET /timeentries - Get all time entries for the projects for which the user has access to.

GET /tasks/{taskId}/timeentries - Get time entries for a specific task.

OData $filter and $orderby options can be supplied to filter and order the results. $top and $skip to get top N items and skip the top M. Read more how to use the OData options

Response

HTTP/1.1 200

{
  "totalResults": 3,
  "top": 3,
  "results": [
     {
       "id": 1,
       "date": "2013-10-02",
       "hours": 6,
       "type": "Billable",
       "userId": 1,
       "taskId": 10,
       "note": "Api for time entries",
       "week": 40,
       "createdBy": "Paul Smith",
       "createdAt": "2013-06-06T00:00:00",
       "lastModifiedBy": "Paul Smith",
       "lastModifiedAt": "2013-10-09T13:57:28.33"
    },
    {
       "id": 2,
       "date": "2013-10-03",
       "hours": 6,
       "type": "Billable",
       "userId": 1,
       "taskId": 10,
       "note": "Create some test data",
       "week": 40,
       "createdBy": "Paul Smith",
       "createdAt": "2013-06-06T00:00:00",
       "lastModifiedBy": "Paul Smith",
       "lastModifiedAt": "2013-10-09T13:57:28.33"
    },
    {
       "id": 3,
       "date": "2013-10-04",
       "hours": 6,
       "type": "Billable",
       "userId": 1,
       "taskId": 10,
       "note": "Fix getting of time entries",
       "week": 40,
       "createdBy": "Paul Smith",
       "createdAt": "2013-06-06T00:00:00",
       "lastModifiedBy": "Paul Smith",
       "lastModifiedAt": "2013-10-09T13:57:28.33"
    },
  ]
}

Create a time entry

POST /timeentries

Request

{
   "date": "2013-10-02",
   "hours": 6,
   "type": "Billable",
   "userId": 1,
   "taskId": 10,
   "note": "Api for time entries",
}

Response

HTTP/1.1 201

{
   "id": 1,
   "date": "2013-10-02",
   "hours": 6,
   "type": "Billable",
   "userId": 1,
   "taskId": 10,
   "note": "Api for time entries",
   "week": 40,
   "createdBy": "Paul Smith",
   "createdAt": "2013-06-06T00:00:00",
   "lastModifiedBy": "Paul Smith",
   "lastModifiedAt": "2013-10-09T13:57:28.33"
}

Update a time entry

PUT /timeentries/{id}

The update can be done partially so only the properties that need to be updated can be provided in the request.

Request

{ "hours": 7 }

Response

HTTP/1.1 200

{
   "id": 1,
   "date": "2013-10-02",
   "hours": 7,
   "type": "Billable",
   "userId": 1,
   "taskId": 10,
   "note": "Api for time entries",
   "week": 40,
   "createdBy": "Paul Smith",
   "createdAt": "2013-06-06T00:00:00",
   "lastModifiedBy": "Paul Smith",
   "lastModifiedAt": "2013-10-09T14:57:28.33"
}

Delete a time entry

DELETE /timeentries/{id}

Response

HTTP/1.1 200