Example APIs
Throughout this tutorial, consider an example of a car dealership which has created a custom back-end CarInfoStore
API to record information about what cars are on the lot, their prices, whether they have been sold or not, and so on. Table 1 shows a group of sample APIs.
API Endpoint | Method | Description |
---|---|---|
/cars | GET | Retrieve a list of all cars in the database. |
/cars | POST | Add a new car to the database. |
/cars/{car id} | GET | Get information about a specific car. |
/cars/{car id} | PUT | Modify information about a specific car. |
/cars/{car id} | DELETE | Remove a specific car from the database. |
/cars/{car id}/status | GET | Retrieve the specific car's status. |
/cars/{car id}/status | PUT | Modify the specific car's status. |
Consider the following example:
You want to add authorization to this existing application using the Entitlements Systems to suit the business needs of the car dealership. For example, only managers can remove specific cars from the database, or modify them once they are recorded. Only sales staff can modify a car's status.