Tasks

Task API Calls

You can retrieve, create, delete, and update tasks. Availability of these functions is based on the requesting users permissions within the system.

  • Get Tasks
  • Create Task
  • Update Task
  • Delete Task


Get Tasks

GET /tasks (Returns all tasks based on the optional filters below)
GET /tasks/{id} (Returns a specific task based on the task ID value)


Optional Parameters

Parameter

Default 

Description

project_id


When included only tasks associated with the requested project will be returned.

type


Options:

  • flagged
  • incomplete
  • complete

date


Options:

  • today
  • tomorrow
  • this-week
  • this-month
  • next-week
  • next-month

start_date


Date format must be set to: YYYY-MM-DD

end_date


Date format must be set to: YYYY-MM-DD

users


Comma separated list or array of user ids assigned to the tasks.

search


Query string value of text matching the task description.

page

1

Sets which page to start retrieving results from. This value is usually used in conjunction with the page_size parameter.

page_size

25

Sets how many tasks to return per page.

Response


When successful a 200 OK status will be returned. 
{
   "_links":{
      "self":{
         "href":"https://api.projecturf.com/tasks?page=1"
      },
      "first":{
         "href":"https://api.projecturf.com/tasks"
      },
      "last":{
         "href":"https://api.projecturf.com/tasks?page=2"
      }
   },
   "_embedded":{
      "tasks":[
         {
            "id":"51207550",
            "parent_id":null,
            "project_id":"6254506",
            "project":"Test Project",
            "author_id":"1304741",
            "author":"Mike P.",
            "task":"Follow up on video animation maker",
            "private":null,
            "flagged":null,
            "start_date":"2015-02-26 00:00:00",
            "due_date":"2015-03-10 23:59:59",
            "estimate":null,
            "status":null,
            "attachments":null,
            "comments":null,
            "updated":"2015-02-27 15:53:05",
            "_links":{
               "self":{
                  "href":"https://api.projecturf.com/tasks/1207550"
               }
            }
         }
      ]
   },
   "page_count":1,
   "page_size":25,
   "total_items":1
}


Create Task

Create a new task and return the corresponding task id.

POST /tasks

Parameter

Required

Default

Description

project_id

Required


Project ID the task is being assigned to.

task

Required


Text of the new tasks being created.

start_date


Today's Date

Use the format YYYY-MM-DD to specify a specific start date.

due_date



Use the format YYYY-MM-DD to specify a specific due date.

status


0

0 = not complete, 1 = completed

flagged


0

0 = not flagged, 1 = flagged

private


0

0 =  not private (all users on the project can see the task), 1 = private (only users assigned to the task can see it, used in conjunction with the 'responsibility' parameter) 

responsibility


All project users

Comma separated list or array of user ids that are responsible for the task.

parent_id



When provided the new task will be created as a sub task of the provided parent_id.

email_alert


0

0 = email notification will not be sent when the new task is created, 1 = email notification will be sent to the responsible users.

estimate


0

Sets a time estimate for the task. The value can be passed as HH:MM (02:30) or as a fraction of an hour H.M (2.5).

notes



Used to set additional text in the Notes field for the task.

Response

When successful a 201 Created status along with the new task ID will be returned.  The new task location is also returned in the response.
{
   "id":"51208228",
   "_links":{
      "self":{
         "href":"https://api.projecturf.com/tasks/51208228"
      }
   }
}


Update Task

Change settings on a specific task

PUT /tasks/{id}

Parameter

Description

project_id

Used to move the task to a new project.

task

Updated description of the task.

start_date

Use the format YYYY-MM-DD to specify a specific a new start date.

due_date

Use the format YYYY-MM-DD to specify a specific a new due date.

status

0 = mark incomplete, 1 = mark complete

flagged

0 = not flagged, 1 = flagged

private

0 =  not private (all users on the project can see the task), 1 = private (only users assigned to the task can see it) 

estimate

Update the time estimate for the task. The value can be passed as HH:MM (02:30) or as a fraction of an hour H.M (2.5).

notes

Update the task notes.

Response


When successful a 200 OK status will be returned.
{
   "id":"51208228",
   "_links":{
      "self":{
         "href":"https://api.projecturf.com/tasks/51208228"
      }
   }
}


Delete Task

Delete a task from the system.

DELETE /tasks/{id}

Parameter

Description

restore

Optional parameter. 0 = delete (default), 1 = restore

Response

When successful a 204 No Content status will be returned.


Feedback and Knowledge Base