Giter VIP home page Giter VIP logo

kanban's Introduction

kanban

by Henarivan Andhika Abhirama

endpoint/url : https://dry-castle-71353.herokuapp.com

GET /tasks

Get all tasks that the user have

Properties

  • token (String)

Request Header

{
   "token" : "<your_token>" 
}

Response

Status 200

[
    {
        "id": 35,
        "title": "Belajar Vue",
        "category": "Backlog",
        "difficulty": "Easy",
        "createdAt": "2020-03-13T16:21:31.157Z",
        "updatedAt": "2020-03-13T16:21:31.157Z",
        "UserId": 7
    },
    {
        "id": 36,
        "title": "Belajar Socket.io",
        "category": "Backlog",
        "difficulty": "Easy",
        "createdAt": "2020-03-13T16:21:38.683Z",
        "updatedAt": "2020-03-13T16:21:38.683Z",
        "UserId": 7
    }
]

POST /tasks

Create a tasks

Properties

  • Title (String)
    • Can not be null or empty
  • Category (String)
    • Can not be null or empty
  • Difficulty (String)
    • Can not be null or empty

Request Header

{
   "Content-Type": "application/json",
   "token" : "<your_token>" 
}

Request Body

{
	"title": "Belajar Vue",
	"category": "Backlog",
	"difficulty": "Easy"
}

Response

Status 201

{
    "id": 34,
    "title": "Belajar Vue",
    "category": "Backlog",
    "difficulty": "Easy",
    "UserId": 7,
    "updatedAt": "2020-03-13T16:12:07.139Z",
    "createdAt": "2020-03-13T16:12:07.139Z"
}

Status 400

{
  "status": 400,
  "msg": [
    "Validation errors (title can not be empty)"
  ]
}


PUT /tasks/:id

Update a todo by the id from the todos resources

Properties

  • id (Number)
    • Gotten from the client
  • Title (String)
    • Can not be null or empty
  • Category (String)
    • Can not be null or empty
  • Difficulty (String)
    • Can not be null or empty

Request Headers

{
    "Content-Type": "application/json",
    "token" : "<your_token>"
}

Request Body

{
	"title": "Belajar Vue",
	"category": "Backlog"
}

Response

Status (200)

{
    "title": "Belajar Vue",
    "category": "Backlog"
}

Status (400)

{
  "status": 400,
  "msg": [
    "Validation errors (title can not be empty)",
    "Validation errors (description can not be empty)",
    "Validation errors (due_date can not be empty)"
  ]
}

Status (403)

{
  "status": 403,
  "msg": "You are not authorized"
}

Status (404)

{
  "status": 404,
  "msg": "Todo not found"
}

DELETE /tasks/:id

Delete a tasks

Properties

  • id (Number)
    • Gotten from the client

Request Headers

{
    "Content-Type": "application/json",
    "token" : "<your_token>"
}

Response

Status (200)

{
    "id": 34,
    "title": "Belajar Vue",
    "category": "Backlog",
    "difficulty": "Easy",
    "createdAt": "2020-03-13T16:12:07.139Z",
    "updatedAt": "2020-03-13T16:17:11.341Z",
    "UserId": 7
}

Status (403)

{
  "status": 403,
  "msg": "You are not authorized"
}

Status (404)

{
  "status": 404,
  "msg": "Todo not found"
}

POST /register

Sign up an account

Properties

  • name (String)
    • Can not be null or empty
  • email (String)
    • Can not be null or empty
  • password (String)
    • Can not be null or empty

Request Headers

{
    "Content-Type": "application/json"
}

Request Body

{
	"name": "wow",
	"email": "[email protected]",
	"password": "123"
}

Response

Status (201)

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NywiZW1haWwiOiJ3b3dAZ21haWwuY29tIiwiaWF0IjoxNTg0MTE0OTY4fQ.p8V1NH9dN8m4I_x3yIbTO0SRSRZ8ftodsc2QGiHdq3U"

Status (400)

{
  "status": 400,
  "msg": [
    "Validation errors (Name can not be empty)",
    "Validation errors (Email can not be empty)",
    "Validation errors (Password can not be empty)"
  ]
}

POST /login

Login to an account Generates a token for authentication

Properties

  • email (String)
  • password (String)

Request Headers

{
    "Content-Type": "application/json"
}

Request Body

{
	"email": "[email protected]",
	"password": "123"
}

Response

Status (200)

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NywiZW1haWwiOiJ3b3dAZ21haWwuY29tIiwiaWF0IjoxNTg0MTE1MTgxfQ.-kpgcpK3gcDILZixhH4ZehsfiSziuSbNLwqJZHozyHg"

Status (400)

{
  "status": 400,
  "msg": "Wrong Email / Password"
}

POST /googleLogin

Login to an account with a google acount

Properties

  • Google Token (String)
    • Gotten from google sign-in server

Request Headers

{
    "Content-Type": "application/json"
}

Request Body

{
	"token" : "<token_from_google>"
}

Response

Status (200)

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwiZW1haWwiOiJoZW5hcml2YW5hYUBnbWFpbC5jb20iLCJpYXQiOjE1ODM1NTk5MjF9.q0qRNCzGxjC1TeqsaHxwqINnLu2FXRjTD3IulTJlzE8"

kanban's People

Contributors

henarivanaa avatar rubhiauliatirta avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.