Endpoints - ValeriShap/alevel_hw GitHub Wiki
Create a car
- Type of request: POST
- URL: /cars
- Parameters: none
- Body request : { "manufacturer": "Audi", "color": "black", "price": "250000"}
- Body response : { "id": "1cce21b5-b0a1-4d09-8270-b397a3866369", "manufacturer": "Audi", "color": "black", "price": "250000"}
- Response code: 201 (CREATED)
Info about car
- Type of request: GET
- URL: stores/dc896439-bdfb-462b-959f-2c399fab50cd/cars/1cce21b5-b0a1-4d09-8270-b397a3866369
- Parameters: store_id, car_id
- Body request : none
- Body response : { "manufacturer": "Audi", "color": "black", "price": "250000", "count": "5", "engine" : {
"type": "PASSENGER CAR", "power": "290" }, "passengerCount": "4", "store_id": "dc896439-bdfb-462b-959f-2c399fab50cd"}
- Response code: 200 (OK)
Update profile
- Type of request: PUT
- URL: /users/1c27f3dd-1a72-4b3a-bb09-04d8f865af42
- Parameters: user_id
- Body request : { "name": "Valeria", "email": "[email protected]", "phone": "380684323775", "password": "123456789"}
- Body response : { "id": "1c27f3dd-1a72-4b3a-bb09-04d8f865af42", "name": "Valeria", "email": "[email protected]", "phone": "380684323775", "password": "123456789" }
- Response code: 200 (OK)
Delete car
- Type of request: DELETE
- URL: /cars
- Parameters: none
- Body request : none
- Body response : none
- Response code: 204 (No Content)
Show all cars (error)
- Type of request: GET
- URL: /orders/84dd4ac2-4ec9-419e-b14f-bb69efdf7beb/cars/cce21b5-b0a1-4d09-8270-b397a3866369
- Parameters: order_id, car_id
- Body request : none
- Body response : none
- Response code: 500 (Internal Server Error)
Update profile (error)
- Type of request: PUT
- URL: /users/1c27f3dd-1a72-4b3a-bb09-04d8f865af42
- Parameters: user_id
- Body request : { "name": "Valeria", "email": "[email protected]", "phone": "380684323775", "password": "123456789"}
- Body response : none
- Response code: 403 (Forbidden)