Clothes API Documentation


Clothes Routes

Method URL Body Description
GET /clothes Get a list of all the clothes, will present 10 results per page
GET /clothes?page=2 Get a list of all the cars, will present 10 results in page 2
GET /clothes?sort=price Get a list of all the clothes sort by price, will present 10 results per page
GET /clothes?reverse=yes Get a list of all clothes sorted in descending order, will display 10 results per page
GET /clothes/search?s=red Search for a clothing or a clothing description, will present 10 results per page
GET /clothes/category/coats Get a list of all the clothes in coats category, will present 10 results per page
GET /clothes/prices?min=130&max=240 Get a list of all the clothes priced between 130 and 240, will present 10 results per page
POST /clothes
{
"name": "Red skirt with flowers",
"info": "Info about the clothing",
"sizes": "s,m,l",
"price": 129,
"img": "image.jpg",
"category": "skirts"
}
            
Add a new clothing to the data base, You need a token for this query
PUT /clothes/1
{
"name": "Red skirt with flowers",
"info": "Info about the clothing",
"sizes": "s,m,l",
"price": 99,
"img": "image.jpg",
"category": "skirts"
}
              
Update a clothing (according to ID) in the data base , You need a token for this query
DELETE /clothes/1 Delete a clothing (according to ID) from the data base , You need a token for this query

Users Routes

Method URL Body Description
GET /users
GET /users/usersList Get a List of all users that only admin can access
GET /users/myInfo Get the details of user by his token
POST /users
{
"name":"mendi",
"email":"mendi@walla.com",
"password":"123456"
}
          
Add a new user to the data base
POST (login) /users/login
{
"email":"mendi@walla.com",
"password":"123456"
}
            
User login, if the email and password are correct the server will respond with a token