Skip to content

Latest commit

 

History

History
338 lines (225 loc) · 5.65 KB

kanban.md

File metadata and controls

338 lines (225 loc) · 5.65 KB

Register

Register a new account

  • URL

    /register

  • Method:

    POST

  • URL Params

  • Data Params

    Required:
    Body: {email: [email], password: [password]} Optional:
    Body: {alias: [alias]}

  • Success Response:

    • Code: 200
      Content: {message: "User Registered", email:[email]}
  • Error Response:

    • Code: 400 BAD REQUEST
      Content: {message: "email is already taken"}

    OR

    • Code: 400 BAD REQUEST
      Content: {message: "Please use proper email format"}

    OR

    • Code: 400 BAD REQUEST
      Content: { message: "Password must be between 4 to 32 characters" }

    OR

    • Code: 400 BAD REQUEST
      Content: { message: "Please Fill Email and Password" }

    OR

    • Code: 500 SERVER ERROR

Login

Log in to existing account

  • URL

    /login

  • Method:

    POST

  • URL Params

  • Data Params

    Required:
    Body: {email: [email], password: [password]}

  • Success Response:

    • Code: 200
      Content: {message: "login successful", access_token: [token]}
  • Error Response:

    • Code: 404 NOT FOUND
      Content: {message: "Email not found"}

    OR

    • Code: 401 UNAUTHORIZED
      Content: { message: "Wrong Password" }

    OR

    • Code: 400 BAD REQUEST
      Content: { message: "Please Fill Email and Password" }

    OR

    • Code: 500 SERVER ERROR

Get Task

Get all tasks

  • URL

    /task

  • Method:

    GET

  • URL Params

  • Data Params

    Required:
    Headers: {access_token: [token]}

  • Success Response:

    • Code: 200
      Content:
      [
          {
              "id": [id],
              "name": [name],
              "deadline": [deadline],
              "category": [category],
              "UserId": [uid],
              "updatedAt": [Update Date],
              "createdAt": [Create Date],
              "user": {[alias: alias]}
          },
          {
              "id": [id],
              "name": [name],
              "deadline": [deadline],
              "category": [category],
              "UserId": [uid],
              "updatedAt": [Update Date],
              "createdAt": [Create Date],
              "user": {[alias: alias]},
              "editable: true
          }
      ]
  • Error Response:

    • Code: 401 UNAUTHORIZED
      Content: { message: "Login Error" }

    OR

    • Code: 500 SERVER ERROR

Post Task

Post a new Task

  • URL

    /task

  • Method:

    POST

  • URL Params

  • Data Params

    Required:
    Body: {name: [name], category: [category]}
    Headers: {access_token: [token]}

    Optional:
    Body: {deadline: [deadline]}

  • Success Response:

    • Code: 200
      Content:

      {
          "id": [id],
          "name": [name],
          "deadline": [deadline],
          "category": [category],
          "UserId": [uid],
          "updatedAt": [Update Date],
          "createdAt": [Create Date]
      }
  • Error Response:

    • Code: 401 UNAUTHORIZED
      Content: { message: "Login Error" }

    OR

    • Code: 400 BAD REQUEST
      Content: { message: "Task name may not be empty" }

    OR

    • Code: 400 BAD REQUEST
      Content: { message: "Deadline must be after today" }

    OR

    • Code: 400 BAD REQUEST
      Content: { message: "Invalid Category" }

    OR

    • Code: 500 SERVER ERROR

Put Task

edit existing task

  • URL

    /task

  • Method:

    PUT

  • URL Params Required: id

  • Data Params

    Required:
    Headers: {access_token: [token]}

    Optional:
    Body: {name: [name], category: [category], deadline: [deadline]}

  • Success Response:

    • Code: 200
      Content:

      {
          "id": [id],
          "name": [name],
          "deadline": [deadline],
          "category": [category],
          "UserId": [uid],
          "updatedAt": [Update Date],
          "createdAt": [Create Date]
      }
  • Error Response:

    • Code: 401 UNAUTHORIZED
      Content: { message: "Login Error" }

    OR

    • Code: 401 UNAUTHORIZED
      Content: { message: "User does not have permission" }

    OR

    • Code: 400 BAD REQUEST
      Content: { message: "Invalid Category" }

    OR

    • Code: 500 SERVER ERROR

Patch Task

Change existing task's category

  • URL

    /task

  • Method:

    Patch

  • URL Params Required: id

  • Data Params

    Required:
    Headers: {access_token: [token]}

    Optional:
    Body: {name: [name], category: [category], deadline: [deadline]}

  • Success Response:

    • Code: 200
      Content:

      {
          "id": [id],
          "name": [name],
          "deadline": [deadline],
          "category": [category],
          "UserId": [uid],
          "updatedAt": [Update Date],
          "createdAt": [Create Date]
      }
  • Error Response:

    • Code: 401 UNAUTHORIZED
      Content: { message: "Login Error" }

    OR

    • Code: 401 UNAUTHORIZED
      Content: { message: "User does not have permission" }

    OR

    • Code: 400 BAD REQUEST
      Content: { message: "Invalid Category" }

    OR

    • Code: 500 SERVER ERROR