Intervals API Resource:

document

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

Documents can belong to projects, tasks, milestones or work requests.

Collection

Allowed HTTP Methods
MethodGroup Access
GETAdministrator, Manager, Resource, Executive
Allowed Filters
Filter NameRequired?ExpectsDefaultDescription
public no boolean Limits the list to only documents visible to executive-level users.
taskid no integer1 Limits the list to documents that are part of the task having the ID passed.
milestoneid no integer1 Limits the list to documents that are part of the milestone having the ID passed, either belonging to the milestone itself or belonging to a task that is part of that milestone.
queueid no integer1 Limits the list to documents that are part of the work request having the ID passed.
clientid no integer1 Limits the list to documents belonging to the client with the ID passed; belonging to projects, tasks or milestones that are part of that client.
projectid no integer1 Limits the list to documents belonging to the project with the ID passed, either belonging to the project itself or belonging to tasks or milestones that are part of that project.
moduleid no integer1 Limits the list to documents belonging to tasks that have the module with the ID passed.
personid no integer1 Limits the list to documents originally uploaded by the person with the ID passed.
search no string Limits the list to documents that match the search string.. Searches title, notes, filename and tags.
projectactive no boolean Limits the list to documents belonging to either active or inactive projects.
taskassignedorownedby no integer Excludes task documents in which the person with the ID passed is not a task assignee, owner or follower.
tag no string Limits the list to documents tagged with the tag passed.
datebegin no date Limits the list to documents uploaded on or after the date passed.
dateend no date Limits the list to documents uploaded on or before the date passed.
sortfield no string Sort the list by any of the following fields: id, personid, title, public, datemodified, active, projectlabelid, projectlabel (sorted by project labels alphabeticaly), and projectabel_order (sorted by project label order in Settings & Defaults).
sortdir no string Sets the sort direction of the returned list. Must be either "ASC" or "DESC".
offset no integer Return documents starting from the nth document.
limit no integer 10 Sets a limit to the amount of documents returned in the response.
id no integer A workaround to requesting the member resource, as the collection resource is much more detailed.

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 /document/

To filter the list based on certain parameters:

GET /document/?clientid={value}

Note: You can string together multiple filters.

Member

Allowed HTTP Methods
MethodGroup Access
GETAdministrator, Manager, Resource, Executive
Settable Fields for PUT and POST Requests
Field NameRequired?ExpectsDefaultDescription
personid yes integer
title yes string (255)
notes no string
public no boolean
active no boolean

string (xxx) indicates a string with a maximum length of xxx characters.

Response Fields

The fields below are returned in GET responses. Boolean values are "t" / "f" strings. Numeric IDs and floats are returned as strings. Nullable fields may be JSON null.

Response Fields
Field NameNullableDescription
id no Unique identifier for the document
personid no ID of the person who uploaded the document
title no Document title (often the original filename)
notes yes Notes about the document
public no Whether the document is visible to executive-level users ("t"/"f") (Semantics depend on account; see API filters for `public`)
datemodified no When the document metadata or file was last modified
active no Whether the document record is active ("t") or inactive ("f")
parent_visible no Whether the parent entity (task, project, etc.) is visible to the current user ("t"/"f")
filename no Stored file name
filesize no File size in bytes (often returned as a string in JSON)
vlocalid no Version local identifier within the document/version sequence
mimetype no MIME type of the file (e.g. image/jpeg)
versionid no ID of the current file version
itemid no Internal item id linking the document to its container context
targetid no Target entity id within the parent (e.g. task id when attached to a task)
location_title no Human-readable title of where the document lives (e.g. task title)
project yes Name of the associated project (empty when not on a project context)
projectid yes ID of the associated project
projectlocalidunpadded yes Project local ID without zero-padding (empty when no project)
projectlabelid yes ID of the project label (empty when none)
projectlabel yes Project label name
projectlabel_order yes Sort order of the project label within the account
client yes Name of the associated client (empty when none)
clientid yes ID of the associated client
author no Full name of the person who uploaded the document

When retrieving a collection (GET /document/), the response envelope includes: personid (authenticated user's ID), status ("OK"), code (200), listcount (total matching records before limit/offset), and document (array of result objects). Defaults, no cap on limit, and how to paginate using listcount are described in the API Introduction (Pagination).

Examples

To retrieve one member resource:

GET /document/{id}/

Assuming no errors, the server will respond with 200 OK and the object requested.

Special Functions

download

Allows you to download the most recent version of this document.

GET /document/{id}/download/

Parameters: None.

Start tracking time today

Join 5,000+ companies spending their time wisely with Intervals.

Try Intervals free