A Deep Dive into the Power of APIs

A PM’s Tech Toolkit

Siddarth Kengadaran
The Product Guy
Published in
5 min readApr 20, 2024

--

In the previous post, Understanding the Building Blocks, we introduced APIs as the messengers between different parts of your application or other systems. Let’s explore APIs and how they make fantastic product features possible.

Photo by Rubaitul Azad on Unsplash

What is an API?

APIs (Application Programming Interfaces) are like messengers that allow different parts of your application, or even entirely separate systems, to ‘talk’ to each other.

How do APIs Work?

The Request-Response Flow:

  • Request: Your app says things like, “Find me the latest Beyonce track” (this is the API request).
  • API Acts: The API finds the song in a vast music database.
  • Response: The API sends the song information (and maybe the song file itself ) back to your app.
  • Your App Handles It: Your app presents the track to you and starts playing it.

Behind the Scenes: While it appears seamless to you, all this communication happens in the background and is powered by APIs.

Types of APIs

  • Public APIs: Available to anyone. Examples include social media sharing, maps in apps, etc.
  • Partner APIs: Shared with specific partners for business integrations.
  • Internal APIs: Within a company, connecting teams and systems.
  • Web APIs: The most common type, transferring data over the internet.

API Protocols: The Languages of Communication

  • REST (Representational State Transfer): The most common for web APIs. Leverages familiar HTTP methods (GET to retrieve data, POST to create new data, etc.). It’s known for flexibility and developer-friendliness.

A GET request to an API might fetch a list of new album releases, while a POST request submits a user’s playlist for saving.

  • SOAP (Simple Object Access Protocol): Older and more structured than REST. Built-in security features make it popular for financial or sensitive data transactions.

It might be used internally as part of the subscription and purchase process for extra security.

  • GraphQL: A newer protocol and query language gaining popularity for its efficiency in fetching data. With GraphQL, you can define which specific pieces of data you want, reducing the amount of data transferred.

GraphQL might power the “Discover” section’s search feature, allowing a request like: “Get artist name, song titles, and album art for Taylor Swift songs released after 2020.”

Data Formats: What’s Being Exchanged

  • JSON (JavaScript Object Notation): Lightweight and human-readable, making it incredibly popular with REST APIs. Data is structured like key-value pairs (e.g., “songTitle”: “Break My Soul”, “artist”: “Beyoncé”).
  • XML (Extensible Markup Language): Older than JSON, still used in some systems. It is slightly more complex than JSON but allows defining custom data structures.

Example: Fetching an Artist’s Songs

Our music app has a “Discover” section powered by an API. Here’s a simplified look at how it might work with REST, SOAP, and GraphQL:

  1. User Taps an Artist
  2. An API Request is triggered

REST API with JSON

API Request: Your app sends a GET request to: https://api.musiclibrary.com/artists/taylorswift/songs

API Response (JSON):

{
"songs": [
{
"title": "Love Story",
"album": "Fearless"
},
{
"title": "Shake It Off",
"album": "1989"
}
// More songs...
]
}

SOAP API with XML

API Request (XML): Your app sends a more structured request.

<soap:Envelope>
<soap:Body>
<getArtistSongs>
<artistName>Taylor Swift</artistName>
</getArtistSongs>
</soap:Body>
</soap:Envelope>

API Response (XML) :

<soap:Envelope>
<soap:Body>
<getArtistSongsResponse>
<songs>
<song>
<title>Love Story</title>
<album>Fearless</album>
</song>
<song>
<title>Shake It Off</title>
<album>1989</album>
</song>
</songs>
</getArtistSongsResponse>
</soap:Body>
</soap:Envelope>

GraphQL

API Request (GraphQL):

query {
artist(name: "Taylor Swift") {
name
songs (releasedAfter: 2020) {
title
albumArt
}
}
}

API Response (JSON):

{
"data": {
"artist": {
"name": "Taylor Swift",
"songs": [
{ "title": "Willow", "albumArt": "https://...evermore.jpg" },
{ "title": "Cardigan", "albumArt": "https://...folklore.jpg" }
]
}
}
}

Let us see how APIs enable many of the features in our music app example, which we discussed in the previous post:

The Vast Music Library:

  • The app doesn’t store every song on its servers!
  • APIs likely connect to external music licensing services to access their vast catalogs.

Secure Payments:

  • When you subscribe or make a one-time purchase, APIs communicate with payment gateways (Stripe, PayPal, etc.).
  • This ensures your sensitive financial data is processed securely.

Social Sharing:

Want to tell your friends about a fantastic new track? APIs enable integration with social networks, allowing you to share songs easily.

Tools of Trade: A Look at Postman

While large enterprises might use dedicated API management platforms, tools like Postman offer fantastic functionality for individual developers and smaller teams. Let’s see how Postman can help you:

  • Testing Your APIs: Easily send different requests (GET, POST, etc.) to your APIs during development and inspect the responses. This is crucial when building new features or integrating with external services.
  • Documenting APIs: Postman lets you generate essential documentation, a starting point for internal use and sharing with partners.
  • Mocking APIs: Don’t have a backend ready yet? You can use Postman to mock API responses, allowing your front-end development to continue.
  • Collaboration: Postman supports workspaces and sharing collections of API requests, making it easier for teams to work together.
  • Troubleshooting: When features relying on APIs are buggy, knowing the basics of Postman lets you ask your developers informed questions.
  • Communicating API Changes: Postman-generated documentation can be easier to grasp than raw code when discussing updates with less technical colleagues.
  • Spotting Opportunities: Seeing how Postman can prototype API usage might spark ideas for new API-powered features.

Why Product Managers Should Care About APIs

  • New Features Without Reinventing the Wheel: Need to add podcast streaming? There’s likely an API to connect with podcast services, saving time and development effort.
  • Data-Driven Decisions: APIs can provide access to analytics about how users interact with your app, informing better product choices.
  • Partnerships: APIs allow your app to work with other products. For example, think about smart speakers — APIs might let users control music playback with voice commands.

Next in the series: Power of databases.

What technical topics do you want to see broken down? Leave your suggestions below!

--

--

Siddarth Kengadaran
The Product Guy

Product Consultant, Enabling teams to strategize and build with conscious intention. Currently exploring Spatial Computing (XR) and AI.