Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lewagon/garage-api

API for (repair shop) and cars 🚗
https://github.com/lewagon/garage-api

api rails

Last synced: 2 months ago
JSON representation

API for (repair shop) and cars 🚗

Awesome Lists containing this project

README

        

# 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**!

```bash
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:

```bash
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:

```bash
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:

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