July 29, 2022

How to Use an API: Just the Basics

Written by

Why Should You Use an API?

Computers make many things easier, especially tasks that involve collecting and sorting through vast quantities of data. Gone are the days of searching locally hosted spreadsheets or even digging through filing cabinets in search of the information you want to access. Now, there are databases. If computers are making everything simpler, a quick query should result in everything you need, right?

If your company uses a customer relationship management (CRM) system like Salesforce, the data you are looking for is probably somewhere in their cloud storage. To access it, you will likely need to use an API. 

APIs are useful for more than accessing information for data-driven decision-making. You can also build programs that run searches on the data the server is hosting and transform that information into a different, usable format. Think about the Google Maps API. Rather than building a web mapping platform, companies like Uber can use the API to incorporate Google’s. 

While using an API may seem like unnecessary added work, they are meant to improve information security and the ease with which you can access the data you need to make well-informed business decisions. Unfortunately, ease of use is relative. If you aren’t an IT professional, the prospect of learning how to use an API can seem daunting at first. 

Top API management tools

If you already know how to use an API and are looking for tools manage them, check out this list of the top API management tools.

1 Domo

Visit website

Build a modern business, driven by data. Connect to any data source to bring your data together into one unified view, then make analytics available to drive insight-based actions—all while maintaining security and control. Domo serves enterprise customers in all industries looking to manage their entire organization from a single platform.

Learn more about Domo

2 Treblle

Visit website

Treblle is an all-in-one API Observability platform that helps next-generation companies scale their APIOps.

Learn more about Treblle

3 Mulesoft

Visit website

Use Mulesoft's Anypoint Platform to quickly design, test, and publish API products. Manage APIs, monitor and analyze usage, control access, and protect sensitive data with security policies. With Anypoint API Community Manager, transform portals into digital experiences that turn developers into evangelists by providing self-service API documentation, forums, support, and the personalized resources developers need to be successful.

Learn more about Mulesoft

4 Apigee

Visit website

Package your digital assets as APIs and monetize to unlock new revenue streams for your business with Apigee. Apigee supports the creation and configuration of a broad range of API packages, revenue models, reports, payment gateways, and developer portal integrations. These capabilities help API providers launch fast and gain value from their APIs sooner. Apply AI to your historical API metadata to predict the behavior of your APIs and automatically detect anomalies in real time.

Learn more about Apigee

5 Software AG

Visit website

Software AG's webMethods API Management allows you to reap the benefits of the API economy by managing the entire process of planning, designing, developing and securely exposing your APIs to external developers, partner and consumers. This Software AG solution provides an end-to-end tool chain, enabling you to leverage your current SOA investments for new API initiatives to get more value from your current assets while saving time and reducing the costs of development and training.

Learn more about Software AG

6 IBM API Connect

Visit website

Expertly secure and manage your entire API ecosystem across multiple clouds — including boosting socialization and monetization efforts — with industry-leading IBM API Connect. IBM API Connect® is a complete, intuitive and scalable API platform that lets you create, expose, manage and monetize APIs across clouds. This means you and your customers can power digital applications and spur innovation. Accelerate API developer productivity with simplified methods and a built-in toolkit.

Learn more about IBM API Connect

7 Kong

Visit website

Kong provides comprehensive visibility and empowers application teams to provide consistent security and governance across APIs and services. Empower your development teams to add fine-grained security and traffic policies that provide consistency across services and APIs. Use artificial intelligence to autonomously monitor traffic for anomalies to proactively identify performance and security incidents.

Learn more about Kong

8 Axway

Visit website

API Gateway provides a comprehensive platform for managing, delivering, and securing APIs. It provides integration, acceleration, governance, and security for Web API and SOA-based systems. Axway offers the full lifecycle API management for the next generation, as well as automating the discovery, reuse, and governance of all your APIs across multiple gateways, environments, and vendor solutions.

Learn more about Axway

9 Postman

Visit website

Postman is a collaboration platform for API development. Postman's features simplify each step of building an API and streamline collaboration so you can create better APIs. Quickly and easily send REST, SOAP, and GraphQL requests directly within Postman. Automate manual tests and integrate them into your CI/CD pipeline to ensure that any code changes won't break the API in production. Stay up-to-date on the health of your API by checking performance and response times at scheduled intervals.

Learn more about Postman

10 Cloud Elements

Visit website

Cloud Elements is the first API Integration Platform to virtualize APIs into unified data models that eliminate brittle, point-to-point connections. With your data at the center of a customized Application Ecosystem, you get a cost, scale and performance advantage so you can seize new opportunities, create new experiences and discover what’s next.

Learn more about Cloud Elements

11 SAP Integration Suite

Visit website

Publish, promote, and oversee APIs in a secure and scalable environment with the SAP API Management capability. Empower developer communities to monetize data and digital assets in new channels, devices, and UIs. Encourage more productive collaboration through the entire business ecosystem. Managing and monitoring APIs across various data platforms with real-time analytics, the API Management capability promotes co-innovation among employees, partners, and the developer community.

Learn more about SAP Integration Suite

12 Workato

Visit website

Workato is a single platform used to integrate apps and automate workflows without compromising security and governance. Rapidly accelerate growth by being automation-first across your organization. It enables companies to drive real time outcomes from business events. There is no coding required, and the platform utilizes Machine Learning and patented technology to make the creation and implementation of automations 10X faster than traditional platforms.

Learn more about Workato

How Do APIs Work?

You might not realize it, but you may already be using an API regularly. When was the last time a website gave you the option to log in with your Google or Facebook account? What about having the option of paying with Paypal? Have you used a travel booking site recently? Did you look at the weather app on your phone this morning?

If you answered yes to any of those questions, you have used an API. They are communication tools. You can think of the process of using one as consisting of three parts:

  • User: the person who makes a request
  • Client: the computer that sends the request to the server
  • Server: the computer that responds to the request

Your part in this as the user is simple. You want to do something, whether that is checking the weather or pulling historical sales data from your CRM system. 

You open the CRM system or another application—the client—and request that information. The way you make that request will depend on the API you’re using. In the weather app example, you tell the API which city you want to look at, and it pulls the most up-to-date weather information for you. You might tell the CRM system that you want all of the sales of a particular product from the past five years at your Chicago, Atlanta, and Dallas locations. 

The server is where the information you’re looking for is stored, and it’s what responds to your request. Information about the server appears in the documentation. The documentation will include the endpoints where specific data can be found as well as the structure of the data on the server. 

APIs can be divided based on their architecture, or how they’re constructed. Let’s look at two of the most common types of API architecture. 

SOAP APIs

SOAP stands for Simple Object Access Protocol. With this architectural style, the client and the server communicate with each other using XML. This type of API is popular due to its rigid structure and independence from any specific programming language. While less common than they once were, many organizations still use SOAP APIs.

Examples of SOAP APIs include…

REST APIs

The acronym REST stands for Representational State Transfer. With a REST API, the client and server may communicate with one another using XML, but they aren’t limited to that specific language. This type of API is also more flexible. Think of it as a style guide rather than a strict standard. 

If you have been researching APIs, you may have seen the term RESTful API used, often interchangeably with REST API. The differences between the two are slight, but important. A RESTful API has all of the features of REST architecture, but it differs slightly in that it has a transport protocol and makes cached information accessible at any time rather than displacing it if left unused. The unique features of a RESTful API tend to make it more flexible but less secure. 

Examples of REST APs include:

What Does an API Do?

An API is how two computers talk to each other. The server has the data and sets the language while the client uses that language to ask for information from the server. Servers do not send data without a client requesting it, although developers have found some ways around this with webhooks

For as foundational as they are to many technical operations, the language and syntax of APIs are quite limited. There are four types of actions an API can take:

  • GET: requests data from a server
  • POST: sends changes from the client to the server; think of a POST request as adding information to the server, like making a new entry
  • PUT: revises or adds to existing information
  • DELETE: deletes existing information

When you combine the endpoints with these actions, also called HTTP verbs, you can search or update any available information over an API. You’ll need to check the API documentation to find out how to code these actions, as they’re all different.

API Calls

An API call has three parts: the request the client submits, the retrieval of the requested information, and the delivery of that information from the server to the client. As an API user, you only need to worry about making the initial request.

To do so, you will use the HTTP verbs we just covered, as well as the Universal Resource Indicator (URI) of the server from which you want to request information. Think of the URI as being like the server’s address. To email someone, you need their exact email address or your message will not find them. The same is true of the server. 

Once you know which server you’re making a request to and what that request is, it’s best practice to tell the server about the request and the response you’re looking for with something called a header. This step is important because if the computer doesn’t understand what you’re asking, it can’t give you a response. 

Finally, you will likely need an API key. Think of it as a password that tells the server you’re allowed to access both it and the information you’re requesting. You’ll get a unique string of letters and numbers to use when accessing the API, instead of just adding your email and password every time. If you want to learn more about authorizations and authentications, read this.

Status codes

After you submit your request, you will receive a status code. This number will tell you whether or not your request worked. The status code will also give you information about either the response or what the problem was.

Typically, a status code will start with a 2 or a 4. If it starts with a 2, your request was likely successful. A 4 usually means something went wrong. 

Start Using an API

Many of the APIs you’ll see in your daily business life are meant to move information from one program to similar form fields in another program. This is especially useful when you’re trying to share information that you would otherwise have to enter repeatedly, like sharing leads between your marketing automation platform and your CRM.

The easiest way to start using an API is by finding an HTTP client online, like REST-Client, Postman, or Paw. These ready-to-use tools help you structure your requests to access existing APIs. You will still need to know some of the syntax laid out in the documentation, but there is very little coding knowledge required. If you don’t have a pre-existing coding knowledge base, that’s probably a relief. 

The next best way to pull data from an API is by building a URL from existing documentation. This YouTube video explains how to pull location data from Google Maps via API, and then use those coordinates to find nearby photos on Instagram.

Overall, an API request doesn’t look that much different from a normal browser URL, but the returned data will be in a form that’s easy for computers to read. Here’s what happened when I requested information from the OpenWeather database in my web browser:

Example URL from documentation — request weather for a particular city:

api.openweathermap.org/data/2.5/weather?q={city name}

Type into your browser:

api.openweathermap.org/data/2.5/weather?q=Nashville,TN&APIID={numberslettersnumbersletters}

Be sure to replace “numberslettersnumbersletters” with your API key, or you will receive a 401 status code telling you that your API key was invalid. Without a valid key, your authentication fails. 

Not all APIs will require a key. Many public APIs don’t, like the ones included on this list. If you want to explore APIs without signing up for a free trial or mailing list, a public API like that is the way to go. 

Learn More About APIs

An API is useful for pulling specific information from another program. If you know how to read the documentation and write the requests, you can get lots of great data back. Parsing it, however, can feel overwhelming. That’s where developers come in. They can build programs that display data directly in an app or browser window in an easily consumable format.

This article barely scratches the surface of API technology. I did a lot of research to learn more about APIs. These are the articles and videos that I found most helpful:

Want to connect your programs, but don’t have the time to build a client? There are plenty of companies out there that will connect existing APIs or create custom connections for you. These can range from simple data-triggered apps to full-scale business intelligence integrations that pull huge amounts of data from multiple sources for analysis. Knowing how an API works is the first step to building great integrations.