Skip to content

lewagon/garage-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wagon - Garage API 🚗

This API will help you store information about cars stored in your garage (repair shop 🛠). Four HTTP endpoints are here for you to use:

Retrieve the list of cars in a garage

Here's the HTTP request you can run. Be careful, :garage in the URL is dynamic!

verb GET
url: https://garage.api.lewagon.com/:garage/cars     # Default: JSON format
url: https://garage.api.lewagon.com/:garage/cars.xml # Variant: XML format

You may choose any name for your garage. Your buddy and you should have different garage names! Example of garage names: 'reparator-2000', 'bricolman', 'abitbol-and-son', etc.

Add a car to a garage

To add a new car to your garage, you need to send this HTTP request:

verb: POST
url: https://garage.api.lewagon.com/:garage/cars
headers: Content-Type: application/json
body:
  {
    "brand": "PEUGEOT",
    "model": "106",
    "owner": "ssaunier",
    "plate": "123AZ56"
  }

Get infos for a car

If you know the :id of a car, you can retrieve its information with:

verb GET
url: https://garage.api.lewagon.com/cars/:id

Destroy a car

If you know the :id of a car, you can remove it with:

verb: DELETE
url: https://garage.api.lewagon.com/cars/:id