User
Get All User
You can access the list more then 10 users by using the /users endpoint
Request:
 [GET] http://fake-shop-api.ap-south-1.elasticbeanstalk.com/app/v1/users
Response:
{
  "status": "success",
  "count": 2,
  "Data": [
    {
      "address": {
        "street": "123 Main Street",
        "city": "Anytown",
        "state": "Anystate",
        "postalCode": "12345",
        "country": "USA"
      },
      "_id": "64c9e431b3a6a1915d40f099",
      "name": "Iron Man",
      "email": "test@example.com",
      "photo": "https://cdn.pixabay.com/photo/2015/04/08/01/49/superhero-712060_1280.jpg"
    },
    {
      "address": {
        "street": "456 Elm Street",
        "city": "Othertown",
        "state": "Otherstate",
        "postalCode": "67890",
        "country": "USA"
      },
      "_id": "64c9e99fe992b500c90d745e",
      "name": "Spider Man",
      "email": "test2@example.com",
      "photo": "https://cdn.pixabay.com/photo/2020/03/29/17/23/spiderman-4981530_1280.jpg"
    }
  ]
}
Get One User
You can access the list more then 10 users by using the /users/<id> endpoint
Request:
 [GET] http://fake-shop-api.ap-south-1.elasticbeanstalk.com/app/v1/users/64c9e431b3a6a1915d40f099
Response:
{
  "status": "success",
  "Data": [
    {
      "address": {
        "street": "123 Main Street",
        "city": "Anytown",
        "state": "Anystate",
        "postalCode": "12345",
        "country": "USA"
      },
      "_id": "64c9e431b3a6a1915d40f099",
      "name": "Iron Man",
      "email": "test@example.com",
      "photo": "https://cdn.pixabay.com/photo/2015/04/08/01/49/superhero-712060_1280.jpg"
    }
  ]
}
Add user
You can add users by using the /users endpoint. And passing user data as JSON in body.
Request:
 [POST] http://fake-shop-api.ap-south-1.elasticbeanstalk.com/app/v1/users
Body:
{
  "name": "Alice Johnson",
  "email": "alicejohnson@example.com",
  "photo": "http://example.com/path/to/alicejohnson/photo.jpg",
  "password": "AliceJohnson123!",
  "cpassword": "AliceJohnson123!",
  "isAdmin": true,
  "address": {
    "street": "789 Oak Street",
    "city": "Sometown",
    "state": "Somestate",
    "postalCode": "54321",
    "country": "USA"
  },
  "phone": "555-555-5557"
}
Response:
{
  "status": "success",
  "data": {
    "id": "64dae8e9e71b28ca6a4c5265",
    "name": "Alice Johnson",
    "email": "alicejohnson@example.com",
    "password": "AliceJohnson123!",
    "address": {
      "street": "789 Oak Street",
      "city": "Sometown",
      "state": "Somestate",
      "postalCode": "54321",
      "country": "USA"
    },
    "photo": "http://example.com/path/to/alicejohnson/photo.jpg"
  }
}
Update User
You can update users by using the /users/<id> endpoint. And passing user data as JSON in body ( You can only send those fields you wants to update ).
Request:
 [PATCH] http://fake-shop-api.ap-south-1.elasticbeanstalk.com/app/v1/users/64dae8e9e71b28ca6a4c5265
Body:
{
  "name": "John Wick"
}
Response:
{
  "status": "success",
  "data": {
    "id": "64dae8e9e71b28ca6a4c5265",
    "name": "John Wick",
    "email": "alicejohnson@example.com",
    "password": "AliceJohnson123!",
    "address": {
      "street": "789 Oak Street",
      "city": "Sometown",
      "state": "Somestate",
      "postalCode": "54321",
      "country": "USA"
    },
    "photo": "http://example.com/path/to/alicejohnson/photo.jpg"
  }
}
Delete User
You can delete users by using the /users/<id> endpoint. And passing user data as JSON in body .
Request:
 [PATCH] http://fake-shop-api.ap-south-1.elasticbeanstalk.com/app/v1/users/64dae8e9e71b28ca6a4c5265
Response:
{
  "status": "success",
  "data": {
    "id": "64dae8e9e71b28ca6a4c5265",
    "name": "John Wick",
    "email": "alicejohnson@example.com",
    "password": "AliceJohnson123!",
    "address": {
      "street": "789 Oak Street",
      "city": "Sometown",
      "state": "Somestate",
      "postalCode": "54321",
      "country": "USA"
    },
    "photo": "http://example.com/path/to/alicejohnson/photo.jpg"
  }
}
Note : For Deleting and Updating you have to create your own user.