Skip to content
Imran Ariffin edited this page Oct 5, 2019 · 4 revisions

Tasks

Tasks Create

Request

POST /v1/tasks/
{
  "parent_id": "abc-123",
  "text": "some-text"
}

Response

201 CREATED
{
  "created": "1970-01-01T12:34:56",
  "id": "pqr-456",
  "parent_id": "abc-123",
  "text": "some-text"
}

Parent does not exist

400 BAD REQUEST
{
  "parent_id": "Parent with id abc-123 does not exist",
  "text": "some-text"
}

Parent id is missing

POST /v1/tasks/
{
  "text": "some-text"
}
400 BAD REQUEST
{
  "parent_id": "This field is required"
}

Text is missing

POST /v1/tasks/
{
  "parent_id": "abc-123"
}
400 BAD REQUEST
{
  "text": "This field is required"
}

Tasks List

Request

GET /v1/tasks/

Response

200 OK
{
  "tasks": [
    {
      "created": "2003-01-01T12:34:56",
      "id": "69c0a292-6c33-4895-9a35-22e4448b187b",
      "parent_id": "9159bf8a-bfe4-4473-8277-5e38961c600e",
      "text": "some-tasks-latest"
    },
    {
      "created": "2002-01-01T12:34:56",
      "id": "7f927688-b450-4eb4-aa28-1739102a70d6",
      "parent_id": "69c0a292-6c33-4895-9a35-22e4448b187b",
      "text": "some-tasks"
    },
    {
      "created": "2001-01-01T12:34:56",
      "id": "68cc1ed9-20b8-485a-ac6c-2566965332ea",
      "parent_id": "9159bf8a-bfe4-4473-8277-5e38961c600e",
      "text": "some-tasks-earliest"
    }
  ]
}
Clone this wiki locally