-
Notifications
You must be signed in to change notification settings - Fork 0
RESTTful API description
📑 Chapter summary
This chapter must provide a good overview of the Web API that your group is going to develop during the course, and some insight into the (imaginary) microservice architecture it will be a part of. You should not focus in implementation aspects such as database structure, interfaces or the request/responses formats. We recommend that you look into existing APIs (see Related work below) before writing the description for your own API.- Understand what is an API
- Describe the project topic API
- Describe how the API would be used as part of a larger architecture
✔️ Chapter evaluation (max 5 points)
You can get a maximum of 5 points after completing this Chapter. More detailed evaluation is provided in the evaluation sheet in Lovelace.📑 Content that must be included in the section
Describe the API you are going to implement. Also describe the larger imaginary architecture that would exist around that API - while you do not need to implement these other components, they will be helpful in imagining context for your API. Your API will be a component that stores, and offers an interface to, some important data in the larger ecosystem. Think about a larger system, and then take out one key piece to examine - this will be your API.
Describe the API briefly and comment what is the main functionality that it exposes. Focus in the API not in any specific application that is using this API. Take into account that in the end, a WEB API is an encapsulated functionality as well as the interface to access that functionality. Remember that your API is just one part of a larger machine. It does not need to do everything. There will be other components in the system to do those things. This course focuses on creating a small API in detail - thinking too big from the start will drown you in work later.
A really short version of an overview for the RESTful Web API could be:
“The discussion forum Web API offers different functionalities to structure non-real-time conversations among the people of a group about topics they are interested in certain topic. Messages are grouped in Threads, that at the same time are grouped in Topics. The messages are accessible to anyone, but posts can only be created by providing credentials of a registered user [...] This API could exist as part of an online learning environment system where it is responsible for offering discussion forum features that can be included in other components of the learning environment. For example, a programming task (managed by a different component) can include its own discussion board managed by the discussion forum API[...]“
Our API features functionality for an user to add recepies to a database and to get suggestions when searching for an ingredient. This way user can get new ideas on what to cook if they happen to have some left over ingredients in their drawers. Especially useful for students, since sometimes they have to get creative on what they cook.
Users must be authenticated to be able to add and search recepies and ingredients.
These recepies are displayed in a feed from the client, depending if the recepies posted from users are private or not they may be viewed.
This could be applied to be a stand alone app or a website or just be integrated to a larger website.
📑 Content that must be included in the section
Define the main concepts and describe the relations among them textually. Roughly, a concept is a real-world entity that is expected to be of interest to users or other services. This section will be a guideline for choosing your resources to implement in Deadline 3. Students should remember that some of the concepts might not be a resource by themselves, but just a part of it (resource property). In this section, students should not describe the RESTful resources, but identify which are the main ideas of the API. Do not forget to include the relations among the concepts.A description of the main concepts for the Forum API could be:
"The API permits users send messages. The forum contains a list of categories and a list of users. Each category specifies a name, a description and a thread. A thread is [...]The forum may contain 0 or more categories… Each category may have 0 or more threads… Users can write and read messages to a forum thread. A user has a profile, basic information, activity information (stores, for instance, all the messages sent by a user, the messages marked as favorites). [...]The user history contains information of the last 30 messages sent by the user.[…]"
Include a diagram which shows the relations among concepts.
This section is important because it outlines the concepts that you will later implement. In particular, the diagram defined here will follow you throughout the project report and you will be adding more details to it.

In this API the user creates Recipes by creating ingredients and instructions, and merging them. Recipes have properties such as instructions, ingredients as a list of individual ingredients, creation date, user, time duration, difficulty, and so on. Every recipe is linked to a user so you can find every recipe of a user and a user of the recipe. Also single ingredients can be traced into a recipe, so one ingredient can have links to multiple recipes. Instructions consist of multiple objects that can also be linked to recipes.
---📑 Content that must be included in the section
Describe at least two clients or services that could use your Web API. You must explain here what is the functionality provided by the client/service, and how it uses the Web API to implement this functionality.One example for a client could be a digital recipe bank for chain restaurants. Recipes could be posted, modified and deleted in the API via POST, PUT and DELERE for the whole chain at once. In restaurants the employees the can get the recipe from the API and then could be displayed for referral and training situations. This could be easily used in a web browser and maintained centrally.
Another use case could be a social media app focused on food where users can add, delete and modify their posts. Posts would be recipes with possibility to add pictures that could be liked. Posts from users would appear in a feed if users decide to have their posts public. This example could be written with Python and using Django.
User-less service that could be implemented would be a service that recommends recipes for the user based on most used ingredients of the user. Some sort of algorithm for sorting could be used for that case. We could see this kind of service to be running in a web client in between other features.
📑 Content that must be included in the section
Find at least one API that resembles the functionality provided by yours. Explain in detail the functionality provided by the API. Classify the API according to its type (RPC, CRUD REST, pure REST, hypermedia driven ...) justifying your selection. Provide at least one example client that uses this API.The purpose of this task is to get more familiar with what an API is. This will be helpful in describing your own API. Therefore, it is recommended to do this section after you have decided the topic of your project but before writing your API description.
One Application Programming Interface (API) which resembles our CookBook is Food API
Project link
This API provides user a way to search and analyze recepies using ”normal” language. Searching for recipies by either nutritional values or ingredients and gaining information of the search such as the cost of the complete recipe.
The Spoonaculars Food API is based on REST.
An example of project utilizing this API is app called Slimfast Keto
The app is meant for users to get access to different meal plans of low-carb and Keto diets. The app can offers different meals based on nutrition information and user preferences. The app is based on the Spoonacular API, which is used to obtain information from their database with the custom ruleset set by the user.
Other applications can be found here
| Task | Student | Estimated time |
|---|---|---|