The following macros are not currently supported in the header:
- style
Get Task
Resource URL
Returns a specific task object
GET /tasks/:id ANY /tasks/:id?_method=get
For example,
GET /tasks/100.json
Would return a json object of task with id 100.
Parameters
Table of allowed parameters.
_fields | partial string | Allows you to specify optional fields and linked objects to include in the response. |
---|
Handling the response
Below is a table of available response fields and objects that are returned within the response object of the returned object. The optional fields and objects can be requested in the _fields
parameter; see included examples. Underlined values are default.
id | unsigned | Activity's unique identifier. This can be used to request other endpoints. |
---|---|---|
title | string | |
custom_id | string | |
standing | string | active, pending, inactive, etc |
billable | unsigned | Total billable minutes |
nonbillable | unsigned | Total non-billable minutes |
budgeted | unsigned | Total budgeted minutes. |
remaining | unsigned | Total remaining minutes |
logged | unsigned | Total minutes logged (includes billable and non-billable) |
date_created | unix ts | |
date_started | unix ts | |
date_commenced | unix ts | |
date_accepted | unix ts | |
date_completed | unix ts | |
date_modified | unix ts | |
date_due | unix ts | |
creator | string | API resource endpoint for the task creator. For example, staff/12 |
creator_type | string | The type of creator. For example, staff or affiliation. |
creator_id | unsigned | Unique identifier for the creator object. |
assignee | unsigned or object | See GET staff/:id for response details. |
type | unsigned or object | |
status | unsigned or object | |
manager | unsigned or object | |
contact | unsigned or object | |
against_id | unsigned int | The id of the object the task is against. |
against_type | string | The type of object the task is against. e.g, prospect, company, issue, job or milestone. |
company | unsigned int | If the task is against a company, this will return the company's id |
company() | object | If the task is against a company, this will return the company's object. |
job | unsigned int | If the task is against a job, this will return the job's id |
job() | object | If the task is against a job, this will return the job's object. |
issue | unsigned int | If the task is against an issue, this will return the issue's id. |
issue() | object | If the task is against an issue, this will return the issue's object. |
milestone | unsigned int | If the task is against a milestone, this will return the milestone's id. |
milestone() | object | If the task is against a milestone, this will return the milestone's object. |
breadcrumbs | array | Contains an array of breadcrumbs for the given task. |
Fields that can be object indicate the field can be requested as a resource. For example.
GET /tasks/1.json?_fields=assignee
would return the task's assignee's staff id. Where as,
GET /tasks/1.json?_fields=assignee(email)
would return the assignee's staff object, including any optional fields or objects within the parenthesis. In the above examples case, it would return the staff objects default values and optional email value.
Sample Response
GET /tasks/1.json?_fields=date_created,date_started,assignee(email),type(color)
{ "response" : { "date_created" : "1003327200", "assignee" : { "email" : "geoff.mcqueen@affinitylive.com", "firstname" : "Geoff", "id" : "1000", "surname" : "McQueen" }, "type" : { "title" : "Default", "id" : "1" }, "title" : "Complaints System Database", "id" : "1", "date_started" : "1003327200" }, { "date_created" : "1017320400", "assignee" : { "email" : "adrian@internetrix.com.au", "firstname" : "Adrian", "id" : "3", "surname" : "Smalley" }, "type" : { "title" : "Default", "id" : "1" }, "title" : "Design Refinement and Tweaking", "id" : "2", "date_started" : "1017320400" }, "meta" : { "status" : "ok", "message" : "Everything executed as expected." } }