Giter VIP home page Giter VIP logo

fancy-todo's Introduction

Fancy-todo API

This is the documentation for using FANCY TODO API. The base url for this API is https://sheltered-taiga-06623.herokuapp.com

This API is using email validator API

To use this app with user interface, kindly visit this link https://todo-fancy-1583330074366.firebaseapp.com/

1. Register (If you Already have an account, you can skip this part)

  • URL

    /user/register

  • METHOD

    POST

  • REQUEST BODY

    Using JSON

    {
      "first_name": "Adhiyatma",
      "last_name": "Pramayoga",
      "email": "[email protected]",
      "password": "secretPassword123"
    }
  • SUCCESS RESPONSE

    • CODE: 200

    • Content:

      {
          "id": 16,
          "first_name": "Adhiyatma",
          "last_name": "Pramayoga",
          "email": "[email protected]",
          "password": "$2b$08$YfyuqhM0Q7zP2WtF9iIZROufOnsV0s4W5Nr7Wh.Eu9xnjAk5AOZc6",
          "updatedAt": "2020-03-07T08:25:50.208Z",
          "createdAt": "2020-03-07T08:25:50.208Z"
      }
  • ERROR RESPONSE

    • Empty Requirement (empty request body)

      • CODE: 400

      • Content:

          {
              "status": 400,
              "error": [
                  {
                      "path": "first_name",
                      "type": "Validation error",
                      "msg": "Please input your name"
                  },
                  {
                      "path": "password",
                      "type": "Validation error",
                      "msg": "Please input the password"
                  }
              ]
          }
    • Email Validation Error

      • CODE: 400

      • Content:

        Wrong format email

        {
            "status": 400,
            "msg": "Invalid format"
        }

        Email not found

        {
            "status": 400,
            "msg": "Email not Found"
        }

2. Log In

  • URL

    /user/login

  • METHOD

    POST

  • REQUEST BODY

    Using JSON

    {
      "email": "[email protected]",
      "password": "secretPassword123"
    }
  • SUCCESS RESPONSE

    • CODE: 200

    • Content:

      {
          "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTYsImVtYWlsIjoiYWRoaXlhdG1hLnByYW1heW9nYUBnbWFpbC5jb20iLCJpYXQiOjE1ODM1NzA3NjN9.IowZiHVsopN5XrvJ_U-l8hOai0LnkTWufgvnALDHm-s"
      }

      Save the token

  • ERROR RESPONSE

    • Email not Found

      • CODE: 404

      • Content:

          {
              "status": 404,
              "msg": "wrong email"
          }
    • Wrong Password

      • CODE: 400

      • Content:

        {
            "status": 400,
            "msg": "wrong password"
        }

3. Get Todos

  • URL

    /todos

  • METHOD

    GET

  • HEADERS

    KEY:

    • token (the token you get after log-in)
  • SUCCESS RESPONSE

    • CODE: 200

    • Content:

      [
          {
              "id": 20,
              "title": "Menambahkan swal",
              "description": "menambahkan swal pada delete",
              "status": "On progress",
              "due_date": "2020-03-07T00:00:00.000Z",
              "createdAt": "2020-03-05T05:43:29.010Z",
              "updatedAt": "2020-03-07T07:53:45.033Z",
              "UserId": 1
          },
          {
              "id": 38,
              "title": "testing lagi",
              "description": "testtest",
              "status": "On progress",
              "due_date": "2020-03-07T00:00:00.000Z",
              "createdAt": "2020-03-05T12:22:59.608Z",
              "updatedAt": "2020-03-07T07:53:52.387Z",
              "UserId": 1
          },
          {
              "id": 71,
              "title": "fitur email verification",
              "description": "menambahkan fitur email verification saat register di fancy todo",
              "status": "Uncomplete",
              "due_date": "2020-03-07T00:00:00.000Z",
              "createdAt": "2020-03-07T03:39:05.852Z",
              "updatedAt": "2020-03-07T07:54:04.130Z",
              "UserId": 1
          },
          {
              "id": 1,
              "title": "Test error",
              "description": "testing error",
              "status": "Completed",
              "due_date": "2020-04-08T00:00:00.000Z",
              "createdAt": "2020-03-02T07:22:04.436Z",
              "updatedAt": "2020-03-05T11:12:49.101Z",
              "UserId": 1
          }
      ]
  • ERROR RESPONSE

    • Server Error

      • CODE: 500

      • Content:

          {
              "status": 500,
              "msg": "Server Error"
          }

4. Add Todo

  • URL

    /todos

  • METHOD

    POST

  • HEADERS

    KEY:

    • token (the token you get after log-in)
  • REQUEST BODY

    Using JSON

    {
          "title": "testing client",
          "description": "test client",
          "status": "Uncomplete",
          "due_date": "2020-04-08T00:00:00.000Z"
    }
  • SUCCESS RESPONSE

    • CODE: 201

    • Content:

      {
          "id": 73,
          "title": "testing client",
          "description": "test client",
          "status": "Uncomplete",
          "due_date": "2020-04-08T00:00:00.000Z",
          "UserId": 1,
          "updatedAt": "2020-03-07T09:01:10.074Z",
          "createdAt": "2020-03-07T09:01:10.074Z"
      }
  • ERROR RESPONSE

    • Validation Error

      • CODE: 400

      • Content:

        {
            "status": 400,
            "error": [
                {
                    "type": "Validation error",
                    "msg": "Please input the title"
                },
                {
                    "type": "Validation error",
                    "msg": "Please input the description"
                }
            ]
        }
    • Server Error

      • CODE: 500

      • Content:

        {
            "status": 500,
            "msg": "Server Error"
        }

5. Get Todo by Id

  • URL

    /todos/todoId

  • METHOD

    GET

  • HEADERS

    KEY:

    • token (the token you get after log-in)
  • SUCCESS RESPONSE

    • CODE: 200

    • Content:

      {
          "id": 73,
          "title": "testing client",
          "description": "test client",
          "status": "Uncomplete",
          "due_date": "2020-04-08T00:00:00.000Z",
          "createdAt": "2020-03-07T09:01:10.074Z",
          "updatedAt": "2020-03-07T09:01:10.074Z",
          "UserId": 1
      }
  • ERROR RESPONSE

    • Not Found

      • CODE: 404

      • Content:

        {
            "status": 404,
            "msg": "404 Not Found"
        }
    • Server Error

      • CODE: 500

      • Content:

        {
            "status": 500,
            "msg": "Server Error"
        }

6. Edit Todo

  • URL

    /todos/todoId

  • METHOD

    PUT

  • HEADERS

    KEY:

    • token (the token you get after log-in)
  • REQUEST BODY

    Using JSON

    {
          "title": "test error",
          "description": "testing error",
          "status": "complete",
          "due_date": "2020-04-08T00:00:00.000Z"
    }
  • SUCCESS RESPONSE

    • CODE: 201

    • Content:

      {
          "title": "test error",
          "description": "testing error",
          "status": "complete",
          "due_date": "2020-04-08T00:00:00.000Z",
          "UserId": 1
      }
  • ERROR RESPONSE

    • Validation Error

      • CODE: 400

      • Content:

        {
            "status": 400,
            "error": [
                {
                    "type": "Validation error",
                    "msg": "Please input the title"
                },
                {
                    "type": "Validation error",
                    "msg": "Please input the description"
                }
            ]
        }
    • Not Found

      • CODE: 404

      • Content:

        {
            "status": 404,
            "msg": "404 Not Found"
        }
    • Server Error

      • CODE: 500

      • Content:

        {
            "status": 500,
            "msg": "Server Error"
        }

7. Delete Todo

  • URL

    /todos/todoId

  • METHOD

    DELETE

  • HEADERS

    KEY:

    • token (the token you get after log-in)
  • SUCCESS RESPONSE

    • CODE: 200

    • Content:

      {
          "id": 73,
          "title": "testing client",
          "description": "test client",
          "status": "Uncomplete",
          "due_date": "2020-04-08T00:00:00.000Z",
          "createdAt": "2020-03-07T09:01:10.074Z",
          "updatedAt": "2020-03-07T09:01:10.074Z",
          "UserId": 1
      }
  • ERROR RESPONSE

    • Not Found

      • CODE: 404

      • Content:

        {
            "status": 404,
            "msg": "404 Not Found"
        }
    • Server Error

      • CODE: 500

      • Content:

        {
            "status": 500,
            "msg": "Server Error"
        }

fancy-todo's People

Contributors

adhiyatmarama avatar stefkwan 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.