Intervals API Resource: time
The base URL for this resource is located at
https://api.myintervals.com/time/
Collection
Allowed HTTP Methods | |
---|---|
Method | Group Access |
GET | Administrator, Manager, Resource, Executive |
Allowed Filters | ||||
---|---|---|---|---|
Filter Name | Required? | Expects | Default | Description |
activeonly | no | boolean | If set to true, limits the list to time entries for active projects and people only. | |
moduleid | no | integer1 | Limits the list to time entries belonging to the module whose ID was passed. | |
taskid | no | integer1 | Limits the list to time entries belonging to the task whose ID was passed. | |
worktypeid | no | integer1 | Limits the list to time entries belonging to the worktype whose ID was passed. | |
personid | no | integer1 | Limits the list to time entries belonging to the person whose ID was passed. | |
clientid | no | integer1 | Limits the list to time entries belonging to the client whose ID was passed. Passing a value of -1 returns time entries belonging to projects that do not have a client. | |
projectid | no | integer1 | Limits the list to time entries belonging to the project whose ID was passed. | |
milestoneid | no | integer1 | Limits the list to time entries belonging to the milestone whose ID was passed. Passing a value of -1 returns time entries that are not associated with any milestone. | |
date | no | date | Limits the list to time entries occurring on the date passed. | |
datebegin | no | date | Limits the list to time entries occurring after the date passed. | |
dateend | no | date | Limits the list to time entries occurring before the date passed. | |
datemodifiedbegin | no | datetime | Limits the list to time modified after the date passed. | |
datemodifiedend | no | datetime | Limits the list to time modified before the date passed. | |
billable | no | boolean | Limits the list to time entries marked as either billable or unbillable. | |
approved | no | boolean | Limits the list to time entries on timesheets that have been approved (for 't') or timesheets that have not been approved (for 'f'). | |
sortfield | no | string | Sort the list by any of the following fields: id, t.date, datemodified | |
sortdir | no | string | Sets the sort direction of the returned list. Must be either "ASC" or "DESC". | |
offset | no | integer | Return time starting from the nth time entry. | |
limit | no | integer | 10 | Sets a limit to the amount of time entries returned in the response. |
1 Indicates that multiple values are allowed, in CSV format (e.g. "3,5,11,19").
2 This field accepts HTML, but certain HTML elements may be stripped out.
Examples
To retrieve the entire list of this resource:
GET /time/
To filter the list based on certain parameters:
GET /time/?sortdir={value}
Note: You can string together multiple filters.
Member
Allowed HTTP Methods | |
---|---|
Method | Group Access |
GET | Administrator, Manager, Resource, Executive |
DELETE | Administrator, Manager, Resource |
POST | Administrator, Manager, Resource |
PUT | Administrator, Manager, Resource |
Settable Fields for PUT and POST Requests | ||||
---|---|---|---|---|
Field Name | Required? | Expects | Default | Description |
projectid | no | integer | For adding general time, projectid is required, as is moduleid; the taskid field must be left blank (otherwise the entry will be interpreted as task time). For adding time associated with a task, this field, along with the moduleid field, may be left blank, as its values will be ignored. | |
moduleid | no | integer | For adding general time, moduleid is required, as is projectid; the taskid field must be left blank (otherwise the entry will be interpreted as task time). For adding time associated with a task, this field, along with the projectid field, may be left blank, as its values will be ignored. | |
taskid | no | integer | For adding time associated with a task, taskid is required. Since the task contains project and module information, moduleid and projectid may be left blank. By passing taskid, any values you pass for projectid and/or moduleid will be ignored. | |
worktypeid | yes | integer | The worktypeid you pass should be associated with the project you pass, or in the case of task time, the project of the task you pass. | |
personid | yes | integer | The personid you pass should be associated with the project you pass, or in the case of task time, the project of the task you pass. | |
date | yes | date | ||
time | yes | double | The time in decimal format. | |
description | no | string | ||
billable | yes | boolean | ||
datemodified | no | datetime | The date this time entry was modified. |
string (xxx) indicates a string with a maximum length of xxx characters.
Examples
To retrieve one member resource:
GET /time/{id}/
Assuming no errors, the server will respond with 200 OK and the object requested.
To delete a particular member resource:
DELETE /time/{id}/
Assuming no errors, the server will respond with 200 OK.
To create a new member resource:
POST /time/
{ "worktypeid": value, "personid": value, "date": value, "time": value, "billable": value }
Assuming no errors, the server will respond with 201 Created and the newly-created element. This will allow you to get the id of the item you just created and verify the field values. Note: Only required fields were listed here. The entire list of possible fields is above.
To update a member resource:
PUT /time/{id}/
{ "worktypeid": value, "billable": value }
Assuming no errors, the server will respond with 202 Accepted and the entire element. This will allow you to verify the field values.
Intervals API
This documentation is meant to serve as an introduction to getting started with the API.
Documentation
Resources
- client
- contactdescriptor
- contacttype
- document
- expense
- group
- invoice
- invoiceitem
- invoicenote
- invoiceterm
- me
- milestone
- milestonenote
- module
- payment
- paymenttype
- person
- personcontact
- project
- projectlabel
- projectmodule
- projectnote
- projectteam
- projectworktype
- quota
- request
- task
- tasklistfilter
- tasknote
- taskpriority
- taskstatus
- time
- timer
- worktype
API Support
Looking for help?
» Contact our support team.