Apollo API Documentation

Tasks API calls


Get all tasks (for a list)

GET /taskLists/#{task_list_id}/tasks

Returns all task records for a single task list.

Response

{
	"tasks":[
		{
			"id":"80345972",
			"subject":"This is a task",
			"due-date":"",
			...
		},
		{
			"id":"7860930",
			"subject":"This is another task",
			"due-date":"2012-08-05",
			...
		},
		...
	]
}

Get all tasks (in a project inbox)

GET /projects/#{project_id}/inbox

Returns all task records for a project inbox.

Response

{
	"inbox":[
		{
			"id":"80345972",
			"subject":"This is a task",
			"due-date":"",
			...
		},
		{
			"id":"7860930",
			"subject":"This is another task",
			"due-date":"2012-08-05",
			...
		},
		...
	]
}

Get all tasks (for a contact)

GET /contacts/#{contact_id}/tasks

Returns all task records for a contact.

Response

{
	"tasks":[
		{
			"id":"80345972",
			"subject":"This is a task",
			"due-date":"",
			...
		},
		{
			"id":"7860930",
			"subject":"This is another task",
			"due-date":"2012-08-05",
			...
		},
		...
	]
}

Get all tasks (for a case)

GET /cases/#{case_id}/tasks

Returns all task records for a case.

Response

{
	"tasks":[
		{
			"id":"80345972",
			"subject":"This is a task",
			"due-date":"",
			...
		},
		{
			"id":"7860930",
			"subject":"This is another task",
			"due-date":"2012-08-05",
			...
		},
		...
	]
}

Get all tasks (for a deal)

GET /deals/#{deal_id}/tasks

Returns all task records for a deal.

Response

{
	"tasks":[
		{
			"id":"80345972",
			"subject":"This is a task",
			"due-date":"",
			...
		},
		{
			"id":"7860930",
			"subject":"This is another task",
			"due-date":"2012-08-05",
			...
		},
		...
	]
}

Get all personal tasks

GET /tasks/personal?#{search_query}

Returns the personal tasks that are visible to the authenticated user. Use the search query to refine your search. Available parameters are:

  • “page”: in case of top the results are many you can jump to the next page using the “page” parameter.
  • “status”: possible values are 'started', 'notstarted' or 'done' (if you don't pass nothing both 'started' and 'notstarted' are returned).

Response

{
	"tasks":[
		{
			"id":"80345972",
			"subject":"This is a task",
			"due-date":"",
			...
		},
		{
			"id":"7860930",
			"subject":"This is another task",
			"due-date":"2012-08-05",
			...
		},
		...
	]
}

Get task

GET /tasks/#{task_id}

Returns a single task item record, given its integer ID.

Response

{
	"task":{
		"id":"7860930",
		"subject":"This is another task",
		"due-date":"2012-08-05",
		...
	}
}

Complete task

PUT /tasks/#{task_id}/done

Marks the specified task item as done.

Response

Returns HTTP status code 200 on success, or any other code (and possibly error information in JSON format) on error.


Mark task as started

PUT /tasks/#{task_id}/started

Marks the specified task item as started.

Response

Returns HTTP status code 200 on success, or any other code (and possibly error information in JSON format) on error.


Mark task as not started

PUT /tasks/#{task_id}/notstarted

Marks the specified task item as not started.

Response

Returns HTTP status code 200 on success, or any other code (and possibly error information in JSON format) on error.


Create task (in a project task list)

POST /taskLists/#{task_list_id}/tasks

Creates a new task record for the given list. The new record begins its life in the “not started” state. (See the “Complete”, “Mark as started” and “Mark as not started” actions.) The task is added at the bottom of the given list. Assign a task to a person or more than a person by filling the responsibles field. You can specify the task due date with the “due-date” key (containing an UTC timestamp) or with the “time-bucket” key. Possible value for it are: “later” (if you don't want to set a due date), “today”, “tomorrow”, “this week” and “next week”. Note that you can also attach files to the task, but you need to upload the files first and then reference them in the attachments field.

Request

{
	"task":{
		"subject":"This is a task",
		"due-date":"2012-08-05",
		"responsibles":[
			"23998611",
			"4847593",
			...
		],
		// if the “due-date” key is posted this field will be ignored
		"time-bucket":"tomorrow" ,
		"attachments":["332929", "94092840"]
	}
}

Response

Returns HTTP status code 201 (“Created”) on success. The response contain the new task ID. On failure, a non-200 status code will be returned, possibly with error information in JSON format as the response's content.

{
	"task-id":"8872225"
}

Create task (in a project inbox)

POST /projects/#{project_id}/inbox

Creates a new task record for the given project inbox.

Request

{
	"task":{
		"subject":"This is a task",
		"due-date":"2012-08-05",
		"responsibles":"23998611",
		"attachments":["332929", "94092840"]
	}
}

Response

Returns HTTP status code 201 (“Created”) on success. The response contain the new task ID. On failure, a non-200 status code will be returned, possibly with error information in JSON format as the response's content.

{
	"task-id":"66849454"
}

Create task (for a contact)

POST /contacts/#{contact_id}/tasks

Creates a new task record for the given contact.
In the case of contact tasks, the responsibles field is mandatory.

Request

{
	"task":{
		"subject":"This is a task",
		"due-date":"2012-08-05",
		"responsibles":["3312785", "949830"],
		"attachments":["332929", "94092840"]
	}
}

Response

Returns HTTP status code 201 (“Created”) on success. The response contain the new task ID. On failure, a non-200 status code will be returned, possibly with error information in JSON format as the response's content.

{
	"task-id":"3312785"
}

Create task (for a case)

POST /cases/#{case_id}/tasks

Creates a new task record for the given case.
In the case of case tasks, the responsibles field is mandatory.

Request

{
	"task":{
		"subject":"This is a task",
		"due-date":"2012-08-05",
		"responsibles":["3312785", "949830"],
		"attachments":["332929", "94092840"]
	}
}

Response

Returns HTTP status code 201 (“Created”) on success. The response contain the new task ID. On failure, a non-200 status code will be returned, possibly with error information in JSON format as the response's content.

{
	"task-id":"21651119"
}

Create task (for a deal)

POST /deals/#{deal_id}/tasks

Creates a new task record for the given deal. .
In the case of deal tasks, the responsibles field is mandatory.

Request

{
	"task":{
		"subject":"This is a task",
		"due-date":"2012-08-05",
		"responsibles":["3312785", "949830"],
		"attachments":["332929", "94092840"]
	}
}

Response

Returns HTTP status code 201 (“Created”) on success. The response contain the new task ID. On failure, a non-200 status code will be returned, possibly with error information in JSON format as the response's content.

{
	"task-id":"90853928"
}

Create personal task

POST /tasks/personal

Creates a new personal task record.

Request

{
	"task":{
		"subject":"This is a task",
		"due-date":"2012-08-05",
		"responsibles":[
			"23998611"
		]
		// if the “due-date” key is posted this field will be ignored
		"time-bucket":"tomorrow",
		"attachments":["332929", "94092840"]
	}
}

Response

Returns HTTP status code 201 (“Created”) on success. The response contain the new task ID. On failure, a non-200 status code will be returned, possibly with error information in JSON format as the response's content.

{
	"task-id":"8872225"
}

Update task

PUT /tasks/#{id}

Updates a specific task. Note that you can also upload files using this function, but you need to upload the files first and then attach them.

Request

{
	"task":{
		"subject":"This is an updated task",
		"state":"started", // possible values: “not started”, “started” and “done”
		"position":"5"
	}
}

Response

Returns HTTP status code 200 on success, or any other code (and possibly error information in JSON format) on error.


Destroy task

DELETE /tasks/#{id}

Delete the task with the given ID.

Response

Returns HTTP status code 200 on success, or any other code (and possibly error information in JSON format) on error.


Reorder tasks (in a given task list)

POST /taskLists/#{task_list_id}/tasks/reorder

Changes the ordering of the tasks for the given list. Completed tasks cannot be reordered, and any task not specified will be sorted after the tasks explicitly given (allowing you to easily move a single task to the head of the list without having to specify the positions of all the other tasks). You may reparent tasks by putting tasks from one list into the ordering of tasks for a different list (though tasks cannot be reparented across project boundaries).

Request

{
	"tasks":[
		"90818577",
		"34917854",
		"33146642",
		"1531984"
	]
}

Response

Returns HTTP status code 200 on success, or any other code (and possibly error information in JSON format) on error.


Reorder tasks (in a project inbox)

POST /projects/#{project_id}/reorderTasks

Changes the ordering of the tasks for the inbox of the given project.

Request

{
	"tasks":[
		"90818577",
		"34917854",
		"33146642",
		"1531984"
	]
}

Response

Returns HTTP status code 200 on success, or any other code (and possibly error information in JSON format) on error.


My tasks

GET /my-tasks

Returns the personal tasks that are visible to the authenticated user. Available parameters are:

  • “view”: possible values are 'my_tasks' (Tasks i should keep an eye on), 'tasks_assigned_to_me', 'tasks_assigned_by_me', 'tasks_created_by_me', 'personal_tasks'.
  • “sort”: possible values are 'due_date', 'start_date', 'creation_date', 'priority', 'estimated_time'.
  • “group”: possible values are 'type', 'responsible', 'dont_group', 'priority', 'status'.
  • “query”: a string used to filter the tasks.
  • “project_id”: the project id to filter the tasks (optional).

Response

{
	"tasks":[
		{
			"id":"80345972",
			"subject":"This is a task",
			"due-date":"",
			...
		},
		{
			"id":"7860930",
			"subject":"This is another task",
			"due-date":"2012-08-05",
			...
		},
		...
	]
}