Back to BlogEngineering

RESTify Your Knowledge: Essential Intro to REST APIs

API stands for Application Programming Interface — a middleman that allows applications to talk to each other. Learn the fundamentals of REST APIs.

Nandhini R
Apr 23, 2024 3 min read
RESTify Your Knowledge: Essential Intro to REST APIs

What is an API?

API stands for Application Programming Interface. In simpler terms, it's a middleman that allows applications to talk to each other. APIs are all around us — every time you use a ride-sharing app, send a mobile payment, or adjust your thermostat from your phone, you're using an API.

APIs follow a client-server architecture: the client (a software application or end user) sends a request, and the server returns the requested data as a response — typically in JSON format.

Why APIs?

Abstraction

APIs hide the complexity of the underlying software or service. The client uses the API without needing to understand how it was built internally.

Extensibility

Once created, an API can be used by any number of consumers. It allows developers to build add-ons, plugins, and custom integrations that enhance the base application.

Standardisation

APIs provide a common language for software communication, reducing development complexity and ensuring different applications can understand each other's data.

Innovation

By combining APIs from multiple services, developers can create entirely new applications or features that wouldn't be possible otherwise — fuelling creativity across the software landscape.

API Categories

  • Public APIs: Open to any organisation. Generally less secure. Example: weather forecasts, social media platforms.
  • Private APIs: Developed for internal use within an organisation to communicate between departments. Access is restricted based on need. Example: a bank's internal account management API.
  • Partner APIs: Shared with selected private third parties for access to specific data. High security. Example: airlines sharing flight availability with partner booking platforms.
  • Composite APIs: Multiple APIs integrated together and used as a single unit. Example: a travel app combining flight details from multiple airlines.

API Design: Verbs and Nouns

In HTTP requests, every call combines an action (verb) and a target resource (noun). HTTP methods — PUT, GET, POST, DELETE — are verbs describing the action to perform. URIs are nouns identifying the resource being acted on. As a standard, URIs should be designed as nouns describing the resource, not as instructions for the function being performed.

HTTP Methods

GET

Retrieves data from the server. When you type a URL into your browser, you're sending a GET request. Used for loading web pages, images, videos, and any read-only data retrieval.

POST

Sends data to the server to create a new resource. Data is included in the request body, separate from the URL. Example: creating a new user record with id '445'.

PUT

Updates or completely replaces the resource at a specified URL using the data in the request body. Example: updating a user's name and age with new values.

DELETE

Permanently deletes the specified resource from the server. DELETE requests should be used with caution — there is no built-in undo. The resource to delete is identified entirely by the URL.

Other HTTP Methods

  • PATCH: Apply partial modifications to a resource on the server.
  • OPTIONS: Retrieve the HTTP methods supported by the server for a given URI.
  • TRACE: Echo back the received request — used for debugging.
  • HEAD: Retrieve response headers without the response body.
  • CONNECT: Open a tunnel to the server identified by the target resource.

APIs support the high demands of modern software by giving developers flexibility for advanced development, enabling fast connectivity between platforms and devices, and personalising products and services to the individual user.

Want to work with the experts behind this content?

Get a free consultation from the QuarkSek team on QA or Security Engineering.

Book a Free Consultation