Understanding RESTful API's
November 11, 2025
1 Introduction
In this short technical blog, we'll take a closer look at what APIs are and how they function
in modern applications. We'll specically focus on RESTful APIs one of the most widely used
architectural styles for building APIs and explore their working with relatable, real-world ex-
amples. Along the way, we'll break down the key concepts behind designing RESTful APIs,
why they've become a standard in web development, and what makes them more powerful and
exible compared to traditional client-server communication methods. By the end, you'll have a
clear understanding of why RESTful APIs play such a critical role in enabling smooth, scalable,
and ecient interactions between dierent systems and services on the web.
1.1 What is API?
API stands for Application Programming Interface, which acts as a communication bridge be-
tween two software components typically, a client and a server. Instead of allowing users to
directly interact with the server or database, APIs handle that interaction in a structured and
secure way. Whenever a user makes a request, it goes through the API, which then talks to the
server on behalf of the user and sends back the response. This request-response cycle works much
like the typical communication between a web browser and a server, but with added exibility
and control. To better grasp how APIs work in everyday scenarios, let's take a simple example
of a customer ordering food at a restaurant the waiter here plays the role of the API, facilitating
communication between the customer and the kitchen shown below.
The illustration provides a real-world analogy to help us better grasp how APIs function in
a digital environment. restaurant scenario:
Customer: Represents the user or client who is seated at the table. The customer doesn't
directly interact with the kitchen or chef but relies on the waiters to communicate their
order.
Waiters: Act as the API. They serve as the bridge between the customer and the chef. The
waiter's role is crucialthey take the customer's order, pass it to the kitchen, and ensure
the prepared food gets delivered back to the customer. Similarly, APIs receive a request
from the client, forward it to the server (kitchen), and then bring back the appropriate
response.
Chef: Represents the server or backend system that holds the logic and resources. The chef
prepares exactly what's been ordered. Just like the server processes requests and generates
the right data or response. The customer doesn't need to know how the chef prepares the
food, and the chef doesn't directly take orders from the customer. This separation of roles
1
Figure 1: Order Flow Process in a Restaurant
keeps the process smooth and ecientjust like APIs simplify communication between
clients and servers in web applications. By using this analogy, it becomes clear that APIs
are like waiterstaking requests, fetching the right information, and serving it back to the
user in a way that's easy to consume.
The customer doesn't need to know how the chef prepares the food, and the chef doesn't
directly take orders from the customer.
1.2 The Roles of APIs in Client-Server Architecture
Now that we have a basic understanding of what an API is, it's important to explore how
APIs t into the larger framework of modern software systems. One key concept here is client-
server architecture, which forms the foundation of how most web-based applications work today.
What's essential to note is that APIs and client-server architecture are not separate or conicting
concepts. Instead, APIs actually operate within this architecture, serving as the communication
channel between the client and the server.
At its core, client-server architecture is a fundamental design pattern for building distributed
systems. It describes how dierent tasks or responsibilities are divided between two key compo-
nents: the client and the server. The client is typically the interface that the user interacts with
whether it's a web browser, a mobile app, or another system while the server is responsible
for handling requests, processing data, and delivering the required responses. In this model, APIs
act as the bridge, helping the client convey its needs to the server in a structured, standardized
way. Understanding this interaction gives us a clearer view of why APIs are considered reliable,
ecient, and critical for modern software communication.
1.2.1 Client
A client refers to any device, computer, or system that initiates a request for a particular service
or resource from another system, typically known as the server. It acts as the starting point
of communication in a networked environment. Whether it's a smartphone accessing an app, a
laptop loading a website, or software requesting data all of these can be considered clients.
In the context of web applications, clients are often web browsers like Google Chrome, Mozilla
Firefox, or Microsoft Edge, which serve as the interface through which users interact with online
services. The primary role of the client is to send specic requests to the server, expecting a
2
relevant response or service in return. Simply put, the client is the side that asks, while the
server is the side that responds.
1.2.2 Server
A server is essentially a computer or system specically designed to handle incoming requests
from clients and provide appropriate responses. While it functions similarly to regular computers,
its primary role is to listen for requests made by clients and then process, retrieve, or generate the
necessary data or services to full those requests. Servers are not limited to a single location
they are often distributed across data centre's around the world, allowing them to eciently serve
users from dierent geographic regions. This distributed setup ensures better speed, reliability,
and scalability. Whether it's delivering a webpage, providing data from a database, or processing
a transaction, the server is the core system responsible for making sure that client requests are
met with accurate and timely responses.
Let us try to understand how Client-Server Communication Works (Flipkart Example) .
Figure 2: Working of Client-Server Architecture with [Link]
1. User Makes a Request (Client Side): When a user opens a web browser like Chrome or
Firefox and types [Link] into the address bar, that browser acts as the client. The
browser then sends a request over the internet to Flipkart's server asking for the webpage
data.
3
2. Request Reaches the Server (Server Side): The request lands on Flipkart's server, which is
nothing but a specialized computer that stores the data, code, and media related to Flip-
kart's website. The server processes the incoming request, looks for the required webpage,
and prepares a suitable response.
3. Server Responds with Website Data: The response sent back from the server usually con-
sists of HTML, CSS, and JavaScript les.
HTML (HyperText Markup Language) denes the structure of the page (e.g., head-
ings, images, buttons).
CSS (Cascading Style Sheets) handles the visual styling (colors, fonts, layout).
JavaScript (JS) adds interactivity, like search bars, product sliders, etc.
4. Displaying the Website in Browser: Once the browser receives the response (HTML, CSS,
JS), it renders the Flipkart homepage on the user's screen. This is the fully functional web-
site you interact with including product listings, search options, lters, etc. Summary:
5. Request Server Response Rendered Webpage This entire process happens in
milliseconds, making it possible for users to quickly access and shop on platforms like
Flipkart.
To make this concept clearer, let's dive deeper into the role of APIs within the client-server
architecture and see how they streamline the request-response process continuing with our
Flipkart example.
1. Imagine you open Flipkart and search for smartphones under 20,000 or click to check
your order history. In this case, you're not requesting the entire website again you're
requesting specic data from Flipkart's server. This is where APIs come into action.
2. User Action Triggers API Request: Let's say you click on the `My Orders' button. Instead
of reloading the entire page, the browser sends a specic API request behind the scenes to
Flipkart's server API endpoint (e.g., [Link]
3. API Request Sent to the Server: These requests are typically carried out using standard
HTTP methods such as GET, POST, PUT, and DELETE. For example, when fetching
order history, the browser sends a GET request to retrieve the required data.
4. Server Responds with Data (Usually in JSON): The Flipkart server processes the request,
pulls the relevant information from the database (like your order details), and sends back a
response usually in JSON format. JSON (JavaScript Object Notation) is a lightweight
data format that APIs commonly use to exchange information.
5. Browser Uses API Response to Update the Page: Once the API response arrives, JavaScript
running in your browser dynamically updates only that part of the page with your order
history, without refreshing the whole website. This enhances the overall experience by
making it faster, more ecient, and user-friendly.
1.3 Why API's are important in Client-Server Architecture
In contemporary software architecture, APIs (Application Programming Interfaces) serve as crit-
ical intermediaries that facilitate structured communication between disparate software systems.
While earlier models permitted direct interaction between clients and servers, the introduction
4
Figure 3: Working of an API in a Client-Server Architecture
of APIs has signicantly enhanced the robustness, security, and scalability of these interactions.
This section delves into the rationale behind incorporating APIs as a mediating layer, examin-
ing the limitations inherent in direct client-server communication and how APIs have eectively
addressed these challenges over time.
Drawbacks of Traditional Client-Server Architecture
1. Scalability Challenges
As user trac increases, the central server may struggle to keep up, resulting in slower
performance and potential downtime.
2. Strong Interdependence
The client is heavily dependent on the server's logic, making system updates or changes
complex and error-prone.
3. Risk of Total System Failure
If the server encounters an issue or stops working, the entire application becomes inacces-
sible to all users.
4. Inecient Load Handling
All processing tasks fall on the server, leading to performance issues when multiple users
are active simultaneously.
5
5. Lack of Modularity
Integration with external services or separating business logic is dicult due to the tightly
bound structure.
6. Security Concerns
Direct communication increases the risk of exposing sensitive operations or data if not
securely congured.
7. Maintenance Diculties
Managing updates, xing bugs, or scaling features becomes harder as the application grows
in size and complexity.
8. Heavy Network Usage
Without intermediary layers, each client request hits the server directly, consuming more
bandwidth and increasing latency.
9. Absence of Middleware Logic
Features like caching, authentication layers, or load balancing are not naturally present,
making it less ecient.
10. Limited Cross-Platform Reusability
Since logic is bound to the client-server structure, reusing the same code for mobile apps,
web apps, or other platforms becomes harder.
General Purpose of Using APIs
Application Programming Interfaces (APIs) are essential building blocks in modern software
development, enabling seamless interaction between dierent software components. They act as
bridges that connect dierent systems, enabling them to work together smoothly. Here are some
of the core reasons APIs have become integral to today's software landscape
1. Enabling Integration and Interoperability:
Connecting Dierent Systems One of the most basic and important uses of APIs is to
help dierent software systems communicate. For example:
A company's customer management system (CRM) can connect with its accounting
software.
Mobile apps can access cloud storage or services.
Websites can show data from third-party sources like weather updates or social media
feeds.
Building Ecosystems: Tech giants like Google, Amazon, Facebook, and Twitter oer
their APIs to outside developers. This allows others to build apps and services on top of
their platforms. The benets include:
Access to advanced services like Google Maps or Amazon S3 for cloud storage.
Saving time and eort by reusing existing tools instead of building from scratch.
Scalability and reliability thanks to the strong infrastructure of large providers.
Built-in security and compliance with industry standards.
Cross-platform compatibility across devices and operating systems.
6
Regular updates and maintenance handled by the API provider.
Opportunities to earn by creating commercial products using these APIs.
Community support from other developers using the same tools.
APIs can also automate taskslike adding new customers from a website form directly
into a CRM systemmaking business processes more ecient.
2. Sharing Data and Content
Getting Real-Time Information: APIs enable applications to seamlessly access and
integrate real-time data from external systems. For example:
A weather API can provide up-to-date forecasts.
A news API can deliver the latest headlines.
A nancial API can show current stock prices.
Providing Data to Others: Companies can also share their own data through APIs,
giving partners or customers controlled access to specic information.
Content Syndication: Websites can use APIs to display content from other platforms,
such as embedding social media posts or showing product listings from another site.
3. Extending Functionality and Services:
Using Specialized Tools: Instead of building every feature from the ground up, devel-
opers can use APIs to add specic capabilities to their apps, such as:
Payment gateways like Stripe or PayPal.
Maps and location tracking.
Messaging and communication tools.
Articial Intelligence and Machine Learning services.
4. Enhancing Security:
Security is one of the most important reasons APIs are used today. They create a safe
layer between the client (user) and the server (backend system), protecting sensitive data
and systems. Here's how:
No direct access: Clients never touch the server's core data or logic directly.
Strict rules: APIs only allow specic actions, like ordering from a set menu.
Authentication: APIs require users to prove who they are using API keys or tokens.
Server protection: APIs can block suspicious activity, like too many requests, to
prevent overload or attacks.
In short, APIs act like secure gatekeepers. They check every request, conrm the identity
of the user, enforce permissions, and encrypt the data being exchanged. This keeps the
server safe and ensures that only authorized users can access the right information.
The core objectives of APIs can be summarized as follows:
7
(a) Facilitating Seamless Communication APIs standardize the way systems interact,
ensuring consistent and reliable exchanges across diverse platforms.
(b) Enabling Secure and Ecient Data Exchange By abstracting the underlying im-
plementation, APIs allow data to be transmitted securely without exposing internal
mechanisms.
(c) Promoting Reusability and Functionality Sharing APIs enable systems to leverage
each other's capabilities without requiring insight into their internal logic or architec-
ture
2 RESTful API's
2.1 What is REST
Representational State Transfer (REST) is a software architectural style that outlines a set of
guiding principles for building scalable web services. These principles, much like coding con-
ventions, act as rules for structuring APIs eectively. In backend development, especially when
using Express with [Link], we create APIs that perform specic tasks. A group of such APIs
forms what we call a web service. REST helps in shaping these APIs by oering a uniform set of
standards to follow during development. Just like Object-Oriented Programming (OOP) follows
naming rulessuch as capitalizing class names and using lowercase for function namesREST
establishes conventions for API design. It's not a software package or tool you install; rather,
it's a methodology you adhere to when crafting RESTful APIs.
These RESTful APIs are commonly used to execute CRUD operations, which stand for:
1. Create Add new data
2. Read Retrieve existing data
3. Update Modify current data
4. Delete Remove data
To carry out these tasks consistently and eciently, developers lean on REST as a proven
design approach. REST APIs operate using standard HTTP methodsnamely GET, POST,
PUT, and DELETEto interact with and manipulate resources in a system.
Some key features that dene RESTful APIs include:
Statelessness: Each client request is handled independently, without storing any session-
related information on the server.
Separation of Concerns: The architecture promotes a clear division between the client-side
and server-side, allowing them to evolve independently.
Consistent Interface: REST enforces a standardized communication structure, making the
interaction between components predictable and straightforward.
Flexible Data Formats: While multiple formats are supported, JSON and XML are com-
monly used for exchanging information between clients and servers.
8
2.2 Stateless operation
Statelessness in RESTful APIs means that each client request must carry all the information
needed for the server to understand and process it. The server does not save any memory of
previous interactions, treating each request like it's the rst time it's hearing from that client.
Key Principles of RESTful APIs Statelessness:
Every Request Stands Alone: Whether it's a GET request to retrieve information or a
POST to add a new item, each call must include all the relevant datasuch as authorization
tokens, headers, and any required parameters.
No Memory of Past Interactions: The server doesn't track previous conversations or
actions by the client. If a client sends multiple requests, the server processes each one
independently without context from earlier exchanges.
No Server-Side Sessions: Unlike older applications that maintain user sessions on the
server, RESTful APIs do not store such session data. There's no persistent "login state"
or memory on the server's end.
State Management by the Client: When it's necessary to maintain statelike know-
ing if a user is logged in or tracking the contents of a shopping cartit's entirely up to the
client to preserve and send that information with each relevant request.
Common Techniques for Managing State on the Client Side:
Tokens: Clients often send authentication details like a JWT (JSON Web Token) or
API key with every request to verify identity.
Cookies: : These can store session identiers or access tokens and are included
automatically in future requests.
Query Strings and Request Bodies: Information like pagination details (?page=2)
or cart identiers (cartId 123) can be sent in the URL or body to provide necessary
context.
2.3 Why RESTful API's are important
RESTful APIs have become the go-to solution for building web services and mobile apps today.
These APIs are built around the principles of Representational State Transfer (REST)a exible
architecture that relies on standard HTTP methods to communicate with resources. RESTful
APIs hold a similar role and relevance to the API concepts you've encountered earlier in this
section.
Why RESTful APIs are Widely Adopted:
Ease of Use and Familiarity: Since they use standard HTTP methods like GET, POST,
PUT, and DELETE, they feel natural for web developers already familiar with internet
protocols.
Stateless Communication: Every API call is self-contained, meaning the server doesn't
retain any memory of prior requests. This feature boosts reliability and simplies scalabil-
ity.
9
Support for Multiple Formats: While JSON is the most frequently used, RESTful
APIs are capable of transmitting data in other formats too, such as XML, HTML, or even
plain text.
Improved Performance Through Caching: Responses can be cached eectively, which
speeds up processing and reduces strain on the server.
High Scalability: Thanks to its statelessness, REST enables easy horizontal scaling by
distributing workloads across multiple servers as trac increases.
2.4 How RESTful APIs works
RESTful APIs function much like a structured website, but instead of delivering full web pages
for human viewing, they provide raw data and functionality for applications and systems to
interact with each other seamlessly.
Here's a breakdown of how RESTful APIs operate:
Resources (URLs): Everything handled by the APIwhether it's users, products, or or-
dersis treated as a resource. Each of these is identied by a distinct URL, like /user/123.
HTTP Methods (Actions): Clients use familiar HTTP verbs such as GET, POST,
PUT, and DELETE to tell the server what operation they want to perform on a given
resource. We'll go into detail about each of these actions later on.
Stateless Requests: Every API call stands on its own, carrying all the necessary de-
tails within itlike authentication credentials. The server does not store any memory of
previous requests from the client, making the interactions independent.
Data Format JSON: The server typically responds with information formatted in
JSON (JavaScript Object Notation), a lightweight and easily digestible format for both
developers and machines.
Status Codes: The server communicates the outcome of each request using standardized
HTTP status codeslike 200 OK for success or 404 Not Found when a resource isn't
available.
In simpler terms: A client might say, Please get me the data for user at /users/456. The
server processes that request and replies, Here's the user info in JSON, and everything went
ne200 OK!
3 HTTP methods
In this section further we'll understand how clients browser uses HTTP methods to request
resources and let server know what he wants to do with these resources. Let us understand one
by on e all the HTTP methods:
10
3.1 HTTP Methods
Understanding HTTP Verbs in REST APIs
In RESTful architecture, HTTP verbs are used to dene the action a client wants to perform
on a resourcejust like verbs represent actions in grammar.
Here are the commonly used HTTP methods:
GET Fetches or retrieves data from the server.
POST Sends new data to the server, typically to create a new resource.
PUT Replaces an existing resource with updated information. The full resource data is
included in the request.
PATCH Modies part of an existing resource.
DELETE Removes a specied resource from the server.
3.2 Endpoints and URL
An endpoint represents the specic URL where a client sends a request to interact with a re-
source. For example:
GET /users/123
This URL points to the user with ID 123, and the HTTP verb denes what action is taken
on that resource.
3.3 HTTP Status Codes
Status codes are standardized, three-digit numbers returned by the server that describe the result
of the client's request. They help both humans and machines understand what happened with
the request.
1. 1xx Informational These status codes indicate that the request has been received and is
actively being processed.
100 Continue The initial request is received; the client may proceed.
101 Switching Protocols Server agrees to change the communication protocol
per the client's request.
2. 2xx Success These codes indicate that the action requested by the client was successful.
200 OK The request completed successfully.
201 Created Indicates the successful creation of a new resource, typically following a
POST or PUT request.
3. 3xx Redirection These codes signify that additional steps are needed to complete the
request successfully.
301 Moved Permanently The requested resource has been permanently relocated
to a new URI.
11
4. 4xx Client Error The request is malformed or contains errors originating from the client's
side.
400 Bad Request The server couldn't understand the request because there was
something wrong with the way it was written.
401 Unauthorized The client has to prove who they are, like logging in, to access
the requested resource.
5. 5xx Server Error These codes mean the server couldn't nish a valid request due to an
error on its side.
500 Internal Server Error: A general server error occurred, stopping it from
completing the request.
502 Bad Gateway The server, acting as a gateway or proxy, got an invalid response
from another server it was trying to communicate with.
Note : HTTP status codes aren't usually shown directly to users. They quietly handle
the communication in the background, helping your browser and the server stay in sync
during a request. These codes are part of the HTTP response and mainly help the client
and server understand and manage the ow of information. In most cases, users won't
even notice these status codesunless something goes wrong. For example, when a page
doesn't exist, users might see a message like 404 Page Not Found. Behind that message,
the actual status code is quietly doing its job, telling the browser what happened. So while
status codes may not be visible on the surface, they play a very important role in letting
systems know whether things are working smoothly or if there's a problem that needs to
be addressed.
4 Best Practice for Designing REST APIs
4.1 Use Noun for endpoint not Verbs
Nouns is the Foundation of RESTful API Design
One of the key best practices in designing RESTful APIs is using nouns in endpoint paths,
as they represent the resources your API is built to manage. This approach helps keep your API
structure consistent, clear, and reective of the actual entities being worked with.
What Is a Resource?
In REST, a resource is any piece of data your API handlessuch as a user prole, a product
listing, or an order detail. These resources are identied by their URL (endpoint), and the focus
is on the what, not the how.
Why Are Nouns Preferred Over Verbs in URLs?
Nouns Reect Things: Paths like /users or /products/123 immediately convey that you're
dealing with actual data entities or collections. This makes it intuitive for developers to under-
stand what the API is interacting with.
HTTP Verbs Already Dene Actions: Endpoints like /getUsers or /deleteProduct are redun-
dant because the HTTP method (e.g., GET, DELETE) already species the intended action.
Including verbs in URLs clutters the design and violates REST principles.
12
Emphasis on Resources, Not Behaviors: REST is fundamentally resource-centric, not action-
driven. Thinking in terms of nouns keeps your API structure clean and focused on what's being
accessed or manipulated, not how it's being done.
Example Comparison
Poor Design (Verb-Based) RESTful Design (Noun-Based)
/getUser GET /users/123
/postProduct POST /products
/deleteOrder DELETE /orders/789
As you can see, the improved version separates what is being targeted (the resource) from
what is being done (the HTTP verb), achieving a more readable and scalable API design.
4.2 Consistent Naming Convention
Using clear and consistent naming in any software project is importantbut in the world of
APIs, it's absolutely essential. Why? Because names are the rst thing developers interact with.
They set the tone for usability, clarity, and long-term maintenance.
Why Consistency Matters:
Better Usability and Developer Experience (DX)
When API endpoints follow a predictable pattern, developers can easily guess what other
endpoints might look like. This accelerates the learning process for newcomers and ensures
a smoother integration experience for all users.
Easier Maintenance and Scalability
Consistent naming makes it simpler to track bugs, understand data ow, and scale the
project. When names follow a standard pattern, modifying or expanding APIs is far less
error-prone.
Clearer Code and Professional Look
Well-chosen endpoint names are self-explanatory, reducing the need for additional com-
ments or documentation. Clear and readable naming also gives your API a polished,
professional appearance.
4.3 Return meaningful HTTP status code
When building APIs, just returning a response isn't enoughwe should also return the right
status code along with it. This helps both developers and client apps understand exactly what
happened with the request.
Think of it like this: instead of saying something went wrong, you're telling the client what
went wrong and why. That way, users (and even developers) aren't left guessing.
Why This Matters:
Makes Debugging Simpler
By returning the correct code (like 404 or 500), it becomes much easier to pinpoint where
the problem iswhether it's a client-side mistake or a server hiccup.
13
Improves Reliability and Trust
Clear messages paired with accurate status codes make your API feel more dependable.
Clients know what to expect and how to handle dierent scenarios.
Helps Everyone Understand
Even someone without deep technical knowledge can get the gistlike seeing 404 Not
Found and knowing the page or resource doesn't exist. A little clarity goes a long way.
5 Tools and Technologies
Why Is API Testing So Important?
When working with tools like Postman and Hoppscotch, it's natural to wonder why API testing
is such a big deal. So let's break it down and see why testing APIs mattersoften even before
the user interface comes into play.
1. Making Sure the Core Logic Works
APIs form the backbone of your applicationthey're where most of the actual work hap-
pens. Before your UI is fully built and ready, API testing helps conrm that the essential
features and business logic are working properly behind the scenes.
2. Catching Bugs Early On
Finding bugs sooner rather than later can save tons of time, eort, and money. Since APIs
can be tested right after developmenteven before the UI is completethis proactive
shift-left approach helps catch issues early and keeps them from turning into bigger,
messier problems later in the project.
3. Securing the Gateway
APIs act as the bridge between your users and the server. And like any open gate, they're
a prime spot for attackers. Testing your APIs allows you to check for security risks like:
Unauthorized access
Injection attacks
Weak authentication setups Catching and xing these early helps protect your data
and your users.
4. Testing Performance and Scalability
Imagine thousands or even millions of users hitting your API at once. Can it handle the
pressure?
API testing helps you:
See how well your API performs under heavy trac
Spot any bottlenecks or slowdowns
Check response times to make sure users aren't waiting too long for results
This helps ensure a smooth experience even during peak loads.
5. Ensuring Reliability and Graceful Error Handling
You want your API to be stable and predictable. That means:
Giving consistent responses for the same inputs
14
Returning the right status codes for dierent situations
Handling unexpected inputs or failures without crashing
A well-tested API not only works correctlyit also fails gracefully and communicates
clearly when something goes wrong.
There are many other benets to API testing, but these are some of the most essential.
Making testing a habit early in development leads to better software, happier users, and
fewer headaches down the road.
Example of API Testing in Hoppscotch
Figure 4: Real-Time API Testing Using Hoppscotch Tool
6 Example RESTful API
We'll now practically implement RESTful APIs by creating APIs for managing chats details. In
this section, we'll build a basic chat example inspired by apps like WhatsApp or Instagramnot
a full replica, but enough to grasp how the routing structure works.
15
Figure 5: Index Route
The main route in the provided code is responsible for retrieving chat records from the
backend and rendering them on the interface.
Figure 6: New Route
This route triggers a form interface where users can enter and submit new chat messages.
16
Figure 7: Message Creation Interface
Upon clicking the `Create Chat' button post message composition, the application triggers a
POST request that inserts the new chat record into the database, as demonstrated below.
17
Figure 8: POST Request for Storing Chat
18
Figure 9: chat edit route
Figure 10: update route
19
Figure 11: chat delete route
Navigation Flow Summary
User visits /chats to see all chats.
From /chats, user can navigate to /chats/new to create a new chat.
After creating, user is redirected back to /chats.
User can choose to edit a chat by going to /chats/:id/edit.
After editing, user is redirected back to /chats.
Deletion is triggered from /chats (e.g., a delete button), which sends a DELETE request to
/chats/:id.
7 Summary
In this article, we have explored and gained a deeper understanding of how APIs operate, their
critical role within client-server architecture, and the key principles behind RESTful APIs. We
discussed their signicance in modern software development, examined their core characteristics,
and delved into their practical applications in real-world scenarios.
20