Skip to content

API docs

Yuer Lee edited this page Apr 30, 2016 · 3 revisions

API 結構

Route One HTTP Verb Description
/lists POST 驗證清單(cookie)
/tasks GET 取得所有的 Tasks
/tasks POST 新增一個 Task
/tasks/:id PATCH 更新一個 Task
/tasks/:id DELETE 刪除一個 Task

POST /lists

驗證清單(cookie)

Parameters

{
  listName: (String)
}

Responsive

  • 201
{
  tasks: [
    {
      id: (Number),
      text: (String), 
      isDone: (Boolean) 
    }, 
    { ... }
  ]
}

GET /tasks

取得所有的 Tasks

Parameters

{

}

Responsive

  • 200
{
  tasks: [
    {
      id: (Number),
      text: (String), 
      isDone: (Boolean) 
    }, 
    { ... }
  ]
}
  • 401
{
  message: (String)
}
  • 404
{
  message: (String)
}

POST /tasks

新增一個 task

Parameters

{
  text: (String)
}

Responsive

  • 201
{
  id: (Number),
  text: (String),
  isDone: (Boolean)
}

PATCH /tasks/:id

更新一個 task

Parameters

{
  isDone: (Boolean)
}

Responsive

  • 200
{
  id: (Number),
  text: (String),
  isDone: (Boolean)
}
  • 404
{
  message: (String)
}

DELETE /tasks/:id

刪除一個 task

Parameters

{

}

Responsive

  • 200
{
  
}
  • 404
{
  message: (String)
}