Skip to content

Latest commit

 

History

History
137 lines (89 loc) · 2.46 KB

api.markdown

File metadata and controls

137 lines (89 loc) · 2.46 KB

Task Tracker API

The API is RESTful and can be implemented in any language. Here are the basic operations:

/task/create

Creates a new task

Parameters:

  • name Name of the task
  • category (optional) Category ID
  • due (optional) Due date of the task
  • star (optional) Whether the task is starred

Returns: the task object

/task/update

Updates data in the task (name, category, star, etc.)

Parameters:

  • id ID of the task to update
  • name (optional)
  • category (optional)
  • due (optional)
  • star (optional)

Returns: the updated task object

/task/complete

Marks a task as completed. At this point it is archived but retains the same ID.

Parameters:

  • id ID of the task to complete

Returns: the updated task object

/task/list

Gets a list of all the active tasks, or all the tasks in a given category

Parameters:

  • category (optional)

Returns: list of task objects

/time/add

Adds time to the specified task

Parameters:

  • taskid ID of the task
  • minutes Number of minutes to add on the task

Returns: the updated task object

/time/start

Starts the timer for a given task.

Parameters:

  • taskid ID of the task

Returns: the task object

/time/stop

Stops the timer for a given task and adds the time to the task. Using /start and /stop in conjunction has the same effect as using /add by itself. This allows some flexibility in how the time is logged.

Parameters:

  • taskid ID of the task

Returns: the updated task object with elapsed time added

/category/create

Creates a new category

Parameters:

  • name Name of the category

Returns: the new category object

/category/archive

Archives a category. Operation will fail if the category has any active tasks. Not implemented in the first version.

Parameters:

  • id ID of the category to archive

Returns: error object

/category/update

Change the name of the category

Parameters:

  • id ID of the category to update
  • name (optional) New name for the category

Returns: the updated category object

/category/list

Gets a list of all the categories

Parameters: none

Returns: a list of category objects

JSON objects

These are the JSON objects returned by these methods

task

{
    "id": 000,
    "name": "string",
    "category": 000,
    "due": "string",
    "star": boolean,
    "time": 000
}

category

{
    "id": 000,
    "name": "string"
}

error

{
    "success": boolean,
    "message": "string"
}