Intervals API Resource: time

The base URL for this resource is located at
https://api.myintervals.com/time/

Collection

Allowed HTTP Methods
MethodGroup Access
GETAdministrator, Manager, Resource
Allowed Filters
Filter NameRequired?ExpectsDefaultDescription
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 occuring on the date passed.
datebegin no date Limits the list to time entries occuring after the date passed.
dateend no date Limits the list to time entries occuring 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
limit no integer 10

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/?dateend={value}

Note: You can string together multiple filters.

Member

Allowed HTTP Methods
MethodGroup Access
GETAdministrator, Manager, Resource
DELETEAdministrator, Manager, Resource
POSTAdministrator, Manager, Resource
PUTAdministrator, Manager, Resource
Settable Fields for PUT and POST Requests
Field NameRequired?ExpectsDefaultDescription
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}/
{
    "moduleid": value,
    "taskid": value
}

Assuming no errors, the server will respond with 202 Accepted and the entire element. This will allow you to verify the field values.

 

Don’t have an Intervals account? Start your own unlimited trial.

No credit card required. No software to install. Cancel any time.

Try it Free