APIs List for User Side and Admin

POST APIs

1. SignUP API for User

  • URL
    /api/user/signup

  • METHOD POST

  • Passed Objects userName [required],
    mobileNumber [required],
    password [required],
    confirmPassword [required],
    address [required],

  • Success Response

    • Code: 201
      Message: User Created Succesfully..!
      data: { token: "token generetaed" }
  • Error Response

    • Code: 400
      Message: User is already registered

2. SignUP API for Admin (optional)

  • URL
    /api/admin/signup

  • METHOD POST

  • Passed Objects userName [required],
    mobileNumber [required],
    password [required],
    confirmPassword [required],
    restro_address [required],

  • Success Response

    • Code: 201
      Message: Admin Created Succesfully..!
      data: { token: "token generetaed" }
  • Error Response

    • Code: 400
      Message: Admin is already registered

3. Signin for the admin or the user

  • URL /api/admin/signin or /api/user/signin

  • METHOD POST

  • PASSED OBJETCS
    email or username [required],
    password [required]

  • Success Response

    • Code: 200
      Message: User Logged in
      data: { token: "token generetaed", user: "user_info" }
  • Error Response

    • Code: 401
      Message: Invalid password or valid email is required
  • Required Field

    • Auth Need : False
    • Admin Auth Need : False

4. Signout for the admin or the user

  • URL /api/admin/signout or /api/user/signout

  • METHOD POST

**NOTE**: in the headers you have to authorize token and you can get token by signin API

  • Success Response

    • Code: 200
      Message: Signout Successful
      data: null
  • Error Response

    • Code: 401
      Message: Authorization Required
  • Required Filed

    • Auth/ Admin Auth: true/true

5. Add Category

  • URL /api/admin/addCategory

  • METHOD POST

  • PASSED OBJETCS
    category_title [required],
    category_desc [required],
    category_img [required]

  • Success Response

    • Code: 200
      Message: Category Added successfully
      data: { categoryID: "categoryID generetaed", category: "category_info" }
  • Error Response

    • Code: 401
      Message: Invalid or missing details
  • Required Field

    • Auth Need : False
    • Admin Auth Need : True

6. Add Dishes

  • URL /api/admin/addDish

  • METHOD POST

  • PASSED OBJETCS
    dish_name [required],
    dish_desc [required],
    dish_img [required]
    dish_price [required]
    dish_category_name [required from existing]
    dish_stock [required]

  • Success Response

    • Code: 200
      Message: Dish Added successfully
      data: { dish_categoryID: dish_categoryID, dishID: dishID, dish: "dish_info" }
  • Error Response

    • Code: 401
      Message: Invalid or missing details
  • Required Field

    • Auth Need : False
    • Admin Auth Need : True

**7. Book Order **

  • URL /api/user/bookOrder

  • METHOD POST

  • PASSED OBJETCS
    dishID [required],
    mode_of_eating [required],
    status [required]
    user_id [required]
    qty [required]
    total [required]

  • Success Response

    • Code: 200
      Message: Order created successfully
      data: { orderID: orderID, status: status, createdAT: time }
  • Error Response

    • Code: 401
      Message: Invalid or missing details
  • Required Field

    • Auth Need : True
    • Admin Auth Need : False

GET APIs

Get APIs for admin

1. Get All Users

  • URL /api/admin/allUsers

  • METHOD GET

**NOTE**: in the headers you have to authorize token and you can get token by signin API

  • Success Response

    • Code: 201
      data: { users: [ displaying all users] }
  • Error Response

    • Code: 401
      Message: authorization required
  • Required Filed

    • Auth Need : False
    • Admin Auth Need : True

2. Get All Categories

  • URL /api/admin/getCategories

  • METHOD GET

**NOTE**: in the headers you have to authorize token and you can get token by signin API

  • Success Response

    • Code: 201
      data: { users: [ displaying all categories] }
  • Error Response

    • Code: 401
      Message: authorization required
  • Required Filed

    • Auth Need : False
    • Admin Auth Need : True

3. Get All Dishes

  • URL /api/admin/getDishes

  • METHOD GET

**NOTE**: in the headers you have to authorize token and you can get token by signin API

  • Success Response

    • Code: 201
      data: { users: [ displaying all Dishes] }
  • Error Response

    • Code: 401
      Message: authorization required
  • Required Filed

    • Auth Need : False
    • Admin Auth Need : True

4. Get Ongoing Orders (it will be fetch after every 30 seconds)

  • URL /api/admin/getCurrOrder

  • METHOD GET

**NOTE**: in the headers you have to authorize token and you can get token by signin API

  • Success Response

    • Code: 201
      data: { order: [ displaying ongoing order] }
  • Error Response

    • Code: 401
      Message: authorization required
  • Required Filed

    • Auth Need : False
    • Admin Auth Need : True

5. Get All Orders

  • URL /api/admin/getOrders

  • METHOD GET

**NOTE**: in the headers you have to authorize token and you can get token by signin API

  • Success Response

    • Code: 201
      data: { get: [ displaying all orders] }
  • Error Response

    • Code: 401
      Message: authorization required
  • Required Filed

    • Auth Need : False
    • Admin Auth Need : True

6. Get Payment

  • URL /api/admin/getEarning

  • METHOD GET

**NOTE**: in the headers you have to authorize token and you can get token by signin API

  • Success Response

    • Code: 201
      data: { get: [ displaying total earning] }
  • Error Response

    • Code: 401
      Message: authorization required
  • Required Filed

    • Auth Need : False
    • Admin Auth Need : True

Get APIs for user

1. Get Dishes

  • URL /api/user/getDishes

  • METHOD GET

**NOTE**: in the headers you have to authorize token and you can get token by signin API

  • Success Response

    • Code: 201
      data: { get: [ displaying all dishes with category] }
  • Error Response

    • Code: 401
      Message: authorization required
  • Required Filed

    • Auth Need : False
    • Admin Auth Need : True

2. Get All Orders

  • URL /api/user/getAllOrders/:id

  • URL params particular user id

  • METHOD GET

**NOTE**: in the headers you have to authorize token and you can get token by signin API

  • Success Response

    • Code: 201
      data: { get: [ displaying all orders] }
  • Error Response

    • Code: 401
      Message: authorization required
  • Required Filed

    • Auth Need : False
    • Admin Auth Need : True

3. Get Status on particular order

  • URL /api/user/getStatus/:orderID

  • URL params particular order id

  • METHOD GET

**NOTE**: in the headers you have to authorize token and you can get token by signin API

  • Success Response

    • Code: 201
      data: { get: [ display status on particular order] }
  • Error Response

    • Code: 401
      Message: authorization required
  • Required Filed

    • Auth Need : False
    • Admin Auth Need : True