What is REST API and why you (and your business) need it.
Have you ever wondered how is it possible when you read an online book on you laptop, then open this
book
on your tablet or desktop, and this book is opened at exactly the same page where you left it? How
different devices share and aware of state of something (current page of a book, position of a
Youtube
video you watched an hour or a month ago, your login & password in your Iphone banking application)?
One of the greatest challenges of modern computing is its complexity. With
millions of different devices, software applications, services, and systems currently in use, each one
is speaking its own “language." How can they ever hope to have meaningful communications by exchanging
information with each other?
Hence, software developers need to simplify the way how different components of complex systems
communicate. This is where an API concept comes in.
APIs stands for Application Programming Interface. An
interface clearly, and in a unified manner, describes what software does, and how to
make it work. At the same time, inner details of this piece of software is hidden from the outer world;
other
components of the system do not (and should not) know how the actual logic is implemented (this is called
encapsulation, if you're curious).
Contemporary usage of the term API often refers to web APIs, which allow
communication between devices (your mobile phone, desktop, or a humidity sensor in your greenhouse) that
are joined by the Internet.
REST API is a particular case of a Web API. The
idea was introduced by Roy Fielding; it is quite complicated, but now we're interested only
in one thing, and this thing is a client-server architecture.
Here, a server is a computer, usually powerful, which runs software; this sofware offers some
service(s).
Hackers in Hollywood films just love to attack those servers; software itself is often simply
referred to as service - surprisingly.
User's mobile phones, laptops, sensors and software they run - these all are clients.
So, having said that, no matter what kind of business you might be running: a real estate agency, a greenhouse farming, a hospital - if you want your business to be represented in the Internet - you need REST API, because REST API:
- Simplifies development: If APIs didn’t exist, developers would have to write a separate communication protocol for each third-party software or service with which they wanted to communicate. Not only would this be tremendously time-consuming and technically complex, but it would also be highly brittle — if one of the systems changed, it could break the entire protocol and force developers to start from scratch. Creating an APIs establishes a “lingua franca” for wildly divergent systems to speak to each other. Rather than having to learn each other’s unique “language,” both entities can communicate in a common format, which can also be used by any other application or service.
- Provides an abstraction for technical details: Even if everyone spoke the same “language,” communicating between two different systems would still be technically challenging without an APIs. Developers would have to dive deep into low-level concepts such as data formats and data transfer, making it more challenging and laborious—and preventing you from getting quick, easy access to the information you need. APIs solve this problem by presenting a clean, smooth layer of abstraction over the messiness of the underlying technical implementation. Instead of working with low-level communications protocols, developers simply have to look up the syntax of how to send a high-level REST APIs request (a much easier task). With the right REST API, you don’t need to understand the specifics of how the server stores or retrieves the data you’re looking for. You only care about the results that it sends back in response to your request.
- Most popular API architecture: REST isn’t the onlyAPIs architecture out there. The older simple object access protocol (SOAP) architecture is still in use among a minority of organizations. However, REST is by far the predominant choice for building APIs. According to a 2017 report, 83% of APIs use the REST architecture, while 15% make use of SOAP. Meanwhile, just 2% rely on neither of these and instead use Microsoft’s .NET architecture. The status of REST as the most popular API architecture carries with it a number of valuable benefits. For example, it’s easier to find tools and tutorials for working with REST APIs. Tech giants such as Google, Amazon, Microsoft, and Twitter all actively promote REST APIs for accessing and using their services.
- Technical benefits: Why is REST more widespread than SOAP and other APIarchitectures in the first place? Much of its popularity has to do with the inherent technical advantages of the REST architecture. In fact, REST was created in part as an answer to some shortcomings of SOAP. The technical benefits of REST APIs include: REST is compatible with a variety of messaging formats, including XML, YAML, and JSON. However, SOAP only uses XML. This makes REST more flexible and lightweight for certain use cases. REST is much “leaner” than SOAP, without much overhead beyond the HTTP request itself. This makes the performance of REST slightly faster for servers, and much faster when traveling over the network. In contrast, it is necessary to wrap SOAP messages in an “envelope.”
REST APIs have a wide range of use cases — so how can you actually harness the
power of REST APIs for your own organization?
Contact and I'll get
back to you shortly.