A Simple API Definition and How APIs Work

Application Programming Interfaces Table of Contents:


 

You’re finally ready to take that much-needed vacation. You log into an online travel service and it immediately brings in multiple flights you can choose as well as hotel and car rental options. You see the package you like, pay with your credit card, and in just a few minutes, you’ve booked all your plans. You even have links to excursion options you can add on later.

All this fast activity that turns you into a travel-planning wizard was made possible by Application Programming Interfaces (APIs). As you worked your way through the online processes, you interacted seamlessly with various applications—including your browser and website forms. You also connected with data pulled from external applications, which in this case are databases hosted by airlines, hotels and car rental companies. Then there’s the link with your credit card company so you can pay the fees.

As you moved nimbly from one step to the next, you likely did not realize you were interfacing with multiple applications. That’s because APIs took care of all the integrations for you in the background.

In this article, we dive into the details about APIs, including a definition of an API and an explanation of how APIs play such a crucial role in enabling applications to talk with each other. These vital exchanges take place not only among websites and internal applications used to run daily business operations, but also when business partners need to exchange information with each other via integrated applications.

What Is the Definition of an API?

An API is a piece of software within a system that defines how other components or systems can use that system. The API defines the types of requests that can be made, how to make them, and the data formats that must be used. As the acronym suggests, an API consists of three components:

  • Application refers to the primary service you are accessing, whether it’s a website application, a spreadsheet, a mobile app, kiosk, or your company’s internal ERP application. The application lets you access information and input data to complete a specified task. For an application to execute transactions, it needs to interface with you and other applications it relies on to run certain functions and grab the required data—such as a back-end database.
  • Programming refers to the software code that allows the service you are using to communicate with you and other applications. The code translates your requests into a language that other applications can understand so they can fulfill the request—such as asking an ATM to withdraw cash. The ATM uses the API code to check with the bank database to make sure you have sufficient funds.
  • Interface is the view you see when you interact with the main application. This could be a set of fields into which you key-in data, or it could be a touchscreen or a keypad. It could also be the chip reader on a credit card processing device or a barcode scanner. All these graphical user interfaces enable you to communicate with applications.

What Are the API Types?

One of the key values of APIs is that they simplify and speed up software development. Developers can add functionality to an existing application or build applications by using services provided by a third-party application.

Developers typically work with three main API types:

Private APIs

Private APIs are for use within an organization. They integrate the IT systems that run the business and customer-facing applications that allow customers to interact with the business, such as purchasing products or requesting service.

Partner APIs

Partner APIs are shared between two business partners that have integrated software connections to exchange data related to the partnership—such as a hospital submitting claims to an insurance company.

Public APIs

Public APIs are part of the “API economy” and expose an organization’s digital services in a controlled way. They are made available to third-party developers (sometimes for free; sometime for a subscription fee) to tap into the data or functions that an application provides. The application owner may offer access to open portions of an application for use by other organizations in cases where the access benefits both parties.

With all of these APIs, developers don’t have to deal with source code or understand how the other application works. They simply connect their application to leverage the data or a function of that application. APIs thus serve as an abstraction layer between two systems.

How Do APIs Work?

Application programming interfaces consist of two components:

  • The technical specification describes the data exchange options between applications in the form of a request for processing and data-delivery protocols.
  • The user interface through which the applications communicate.

An application that needs to access information or functionality from another application calls the API while specifying the requirements of how the data or the functionality must be provided. The application receiving the request then returns the data or the functionality.

As specialists from Red Hat note, APIs are sometimes considered contracts. The documentation is essentially an “If-Then Agreement” between two applications: “If Application A sends a request structured in a specified way, then this is how Application B will respond.”

The documentation also serves as a manual for developers that includes all the necessary information on how to work with the API and to use the services it provides. Each API contains and is implemented by function calls, which are statements that request an application to perform particular actions.

These can include, for example, requests to start or finish a data exchange session, or to store or retrieve an object from a server. In some cases, composite APIs are used to batch requests sequentially into a single API call. Rather than multiple round trips to a server, a client can make one API request with a chain of calls and receive one response.

How Are APIs Used?

Another way to view APIs is according to their use cases. Web APIs are the most common use case and provide readable data and functionality among web-based systems and application servers.

These APIs typically use the Hypertext Transfer Protocol (HTTP) and make it possible for any desktop or mobile device to tap into a web application.

Another use case is Database APIs, which enable applications to query databases and pull data, run standard reports, and create custom reports. Operating System APIs tell applications how to use the resources and services of operating systems. As an example, these APIs make it possible for applications to run fast by accessing RAM and save files to hard drives. Then there are Remote APIs, which enable one device to access application functions running on another machine.

What Standards Do APIs Follow?

A key attribute of APIs is their ability to standardize data exchanges among diverse systems written in different programming languages and running on various operating systems and hardware platforms. These exchanges are made possible by a common set of API protocols accepted as standards by the software developer community:

  • Remote Procedure Call (RPC) pertains to web APIs and specifies the interaction between client-server based applications. One program (client) requests data or functionality from another program (server), located in another computer on a network, and the server sends the required response.
  • Service Object Access Protocol (SOAP) exchanges structured information in a decentralized, distributed environment and contains the syntax rules for request and response messages sent by web applications.
  • Extensible Markup Language (XML) is widely used for data storage and exchanges over the Internet. The protocol defines a set of rules for encoding documents in a format that both humans and machines can read.
  • Representational State Transfer (REST API) is a software architectural style that defines a set of constraints for creating Web services that conform to the REST architectural style. Often called RESTful Web services, they provide interoperability between computer systems on the Internet.
  • Universal Description, Discovery and Integration (UDDI) is a registry for businesses to list themselves on the Internet. The protocol streamlines online transactions by enabling companies to find one another on the web so they can make sure their systems are interoperable for e-commerce.
  • Web Services Description Language (WSDL) describes network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly and then bound to a concrete network protocol and message format to define an endpoint.

Another common API protocol is GraphQL. It serves as an open-source data query and manipulation language and as a runtime for fulfilling queries with existing data.

The Business Value of APIs

In addition to making it easier for applications to talk to each other so end users can work more efficiently and customers can place orders more quickly, APIs enable businesses to tap into advanced technologies that add value to the business. These include the Internet of Things (IoT), artificial intelligence, robotics, workflow automation, mobility and social media. Whether it’s gathering business intelligence to run more efficient business operations or communicating key information to customers, APIs make all businesses run more smoothly.

Contact us today to learn more about APIs and how we can support your firm’s digital transformation efforts.

Video: The Importance of a Solid API Strategy

YouTube video

 


Application Programming Interfaces Table of Contents: