APIs for managing Tasks

Metadata

:author:
  :name: Neha
  :surname: Tandon

Supported Formats

json

GET /api/tasks
Filter tasks

Get a list of tasks (optionally with some filter). Note only one filter parameter out of the following is supported per request.

Supported Formats

json

Errors

Code Description
400 Bad Request
404 Not Found
500 Internal Server Error

Params

Param name Description
user_id
optional

Id of a user by which tasks would be filtered

Validations:

  • Must be a Integer

created_after
optional

If supplied, only tasks created after this date would be returned

Validations:

  • Must be a String

search
optional

A search string which is used to perform full text search.The following operators are supported between words github.com/mrkamel/search_cop#supported-operators

Validations:

  • Must be a String


POST /api/tasks
Create new task

Supported Formats

json

Errors

Code Description
400 Bad Request
404 Not Found
500 Internal Server Error

Params

Param name Description
name
required

Name of the task

Validations:

  • Must be a String

description
optional , nil allowed

Description of the task

Validations:

  • Must be a String

end_date_on
optional

End date for the task

Validations:

  • Must be a String

user_id
required

Integer id of the user to whom the task belongs

Validations:

  • Must be a Integer


GET /api/tasks/:id
Get a single task

Supported Formats

json

Errors

Code Description
400 Bad Request
404 Not Found
500 Internal Server Error

Params

Param name Description
id
required

Id of the task whose details are required

Validations:

  • Must be a Integer


PUT /api/tasks/:id
Update a task

Supported Formats

json

Errors

Code Description
400 Bad Request
404 Not Found
500 Internal Server Error

Params

Param name Description
name
optional

Name of the task

Validations:

  • Must be a String

description
optional , nil allowed

Description of the task

Validations:

  • Must be a String

end_date_on
optional

End date for the task

Validations:

  • Must be a String

user_id
optional

Integer id of the user to whom the task belongs

Validations:

  • Must be a Integer


DELETE /api/tasks/:id
Delete a task

Supported Formats

json

Errors

Code Description
400 Bad Request
404 Not Found
500 Internal Server Error

Params

Param name Description
id
required

Id of the task to be deleted

Validations:

  • Must be a Integer


GET /api/autocomplete
Autocomplete API

Supported Formats

json

Errors

Code Description
400 Bad Request
404 Not Found
500 Internal Server Error

Params

Param name Description
search
required

Search string for autocompletion

Validations:

  • Must be a String