GETTING STARTED

API Fundamentals for Product Managers

20 lessons
UPDATED: FEB 15, 2023

Overview

Product Managers play a critical role in the success of a platform product by identifying and prioritizing features that drive developer adoption and create value for end-users. Understanding how to do simple API calls is important for several reasons:

  • Communication with developers: Understanding APIs and how they work helps Platform Product Managers communicate more effectively with developers. Product Managers can provide more detailed technical specifications and requirements to developers, which can lead to better outcomes.
  • Product development: Knowledge of APIs enables Platform Product Managers to design and develop products that are more integrated and interoperable with other platforms. This can lead to increased adoption of the platform and a larger user base.
  • Problem-solving: When issues arise with the platform, understanding APIs can help Product Managers identify the root cause of the problem more quickly and efficiently. This can lead to faster issue resolution and a better user experience.
  • Innovation: Knowing how to use APIs can inspire new ideas for platform products and features. Product Managers can identify new opportunities for integration with other platforms, or use APIs to create new features that add value for users.

In short, understanding how to do simple API calls is an essential skill for Platform Product Managers to be effective in their role, communicate better with developers, and create better products.

What you will accomplish

In this tutorial, you will:

  • Understand the basics of RESTful API and HTTP methods
  • Learn to make API calls using the Postman and cURL tools
  • See the response data in a structured format
  • Create a simple API endpoint to test API calls
  • Learn to use HTTP methods like GET, POST, PUT, and DELETE to interact with the API

Prerequisites

  • Postman tool (download and install from https://www.postman.com/downloads/)
  • Basic understanding of HTTP protocol
  • A simple API endpoint to test API calls (you can use choose from this example list)

Implementation

Step 1: Understand REST API

REST stands for Representational State Transfer. It is a type of software architecture that is used to build web services. RESTful APIs [1] are designed to be simple and easy to use, and they are based on HTTP protocol. REST APIs use HTTP methods like GET, POST, PUT, and DELETE to perform operations on resources.

Step 2: Choose an API to work with

To learn how to make a simple API call using a RESTful API, you will need to choose an API to work with. There are many APIs available online that you can use for testing purposes.

  • OpenWeatherMap API: This API provides real-time weather data for any location in the world.
  • NASA API: This API provides access to a variety of NASA data, including images, videos, and astronomical data.
  • Spotify API: This API provides access to the Spotify music catalog, allowing you to search for and play songs, albums, and playlists.
  • Twitter API: This API provides access to Twitter data, including tweets, user profiles, and trends.
  • Google Maps API: This API provides access to Google Maps data, including maps, routes, and geolocation data.
  • Yelp API: This API provides access to Yelp data, including reviews, ratings, and business information.
  • PokéAPI: This API provides access to data on all Pokémon, including statistics, moves, and types.
  • News API: This API provides access to news articles from a variety of sources and categories.
  • GitHub API: This API provides access to data on GitHub repositories, users, and issues.
  • YouTube API: This API provides access to YouTube videos, channels, and playlists.
For this tutorial, we will use the OpenWeatherMap API, which provides weather data for different locations.

Step 3: Get an API key

To use the OpenWeatherMap API, you will need an API key. You can sign up for a free API key on the OpenWeatherMap website (be sure to follow the sign up instructions).

Once you have your API key, you can start making API calls.

Figure 1: OpenWeatherMap API Keys Portal
Save the API Key, you will use it later in Step 5

Step 4: Understand HTTP methods

HTTP methods are used to perform different operations on resources. The most common HTTP methods are GET, POST, PUT, and DELETE.

  • GET: Retrieves data from the server.
  • POST: Sends data to the server to create a resource.
  • PUT: Sends data to the server to update a resource.
  • DELETE: Sends a request to the server to delete a resource.

Step 5: Make a GET request to the OpenWeatherMap API

To make a GET request to the OpenWeatherMap API, you will need to construct a URL with your API key and the location you want to get weather data for. Here's an example URL:

https://api.openweathermap.org/data/2.5/weather?q=London&appid=your_api_key

Replace your_api_key with your actual API key. This URL will get weather data for London.

To make the API call, you can use a tool like cURL or Postman.

Using cURL

Use your terminal to execute this example cURL command. This command will output weather data for London.

{% code-block language="bash" %}
curl "https://api.openweathermap.org/data/2.5/weather?q=London&appid=your_api_key"
{% end-code-block %}

Replace your_api_key with your actual API key.

Your result in the terminal should look like this:

{% code-block language="json" %}
{"coord":{"lon":-0.1257,"lat":51.5085},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"base":"stations","main":{"temp":279.37,"feels_like":277.44,"temp_min":277.84,"temp_max":280.42,"pressure":1018,"humidity":81},"visibility":10000,"wind":{"speed":2.57,"deg":100},"clouds":{"all":99},"dt":1682556608,"sys":{"type":2,"id":2075535,"country":"GB","sunrise":1682570439,"sunset":1682622928},"timezone":3600,"id":2643743,"name":"London","cod":200}
{% end-code-block %}

Congrats! You have made your first API call using cURL!

Using Postman

Open Postman and create a new request by clicking on the "New" button in the top-left corner of the screen. In the request builder, enter the URL of the API you want to call in the "Enter request URL" field. You can also select the request method (GET, POST, PUT, etc.) from the drop-down menu.

Click on the "Send" button to make the API call. Postman will display the response from the API in the lower half of the screen, including the status code, response headers, and response body.

Figure 2: Postman API Request
Replace your_api_key with your actual API key.

If the API requires any parameters or headers, you can add them in the appropriate fields under the "Params" or "Headers" tabs.

Your result in the terminal should look like this:

Figure 3: Postman API Response

Congrats! You have made your first API call using Postman!

Step 6: Make requests using other HTTP methods

As you learned in step 4, you could also try to make a POST, PUT or DELETE requests to the OpenWeatherMap API. However, the OpenWeatherMap API does not support those requests, so you will get an error:

Figure 4: Postman API Request - Method Not Allowed
It is critical to read the respective API Documentation to understand what is allowed, parameters, etc.

You would learn more about API Documentation in the next lesson.

Conclusion

In this tutorial, you learned the basics of RESTful APIs and HTTP methods (GET, POST, PUT, DELETE) and used tools like cURL and Postman to make a simple API calls.

Next Steps

  • Try to replicate these steps with other APIs (you can use choose from the example list above - Step 2).
  • Learn how to read API documentation and familiarized with tools like Swagger and OpenAPI.
  • Explore more advanced features of Postman, such as authentication and environment variables.

Reference materials

[1] What Is A RESTful API?: https://aws.amazon.com/what-is/restful-api/

Opening in Fall 2023

Premium Course

SAve your spot

Join our waiting list

Be the first to know when this course is available

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.