The very first thing a project usually starts with is a definition of the operations the API will expose. According to the REST principles, an operation is exposed by an HTTP method and a URI. The action performed by each operation should not contradict the natural meaning of its HTTP method. The following table specifies the operations of our API in detail:
Method | URI | Description |
GET | /category | Retrieves all available categories in the catalog. |
GET | /category/{category-id}/ | Retrieves all the items available under a specific category. |
GET | /category/{category-id}/{item-id} | Retrieves an item by its ID under a specific category. |
POST | /category |
Creates a new category; if it exists, it will update it. |
POST |