What Is API? Application Programming Interface Meaning & Standards
API stands for Application Programming Interface. A basic to intermediate understanding of API is what they are? Why they are important and what sort of benefits you can get if you start putting them to use in your organization. So read the article until the last word and you’re bound to learn a lot. The most important topics related to Application Programming Interface that we’re going to discuss here are as follows –
- What exactly is an API, and how do they work?
- Why should you invest in an API program?
- How do you productize APIs?
- How do you secure APIs?
- Why is API – first design important?
- How are APIs called?
Whether you are not or you are a developer, who’s consuming API’s and using hem in your software or if you are an organization, thinking about providing API’s. So, the developers can use them, then we are going to talk about how to productize API. So this is a very important issue because a lot of organizations don’t treat their API’s as products. That’s the mistake we are going to talk about, why we are talking about how to treat them like products. So you get the best possible results out of them now. An Application Programming Interface is the sort of thing that hackers really love.
They always look for programmatic interfaces to get there, hacking is done. So it’s very important to secure them whether you are putting them on your corporate network or you are going to be putting them on the internet. In either case, security is one of the first concerns you need to think about. We will talk about security, then we are going to talk about something called API first design and why it’s so very important. Because you want to build the best API’s.
The ones that developers are going to love, to use and that’s what API first design is all about. And, finally we are going to do some hands-on, we are doing to show you how to build an API and how to consume it. So, let’s get started with this first part of this article. Which is what exactly is an API. Well, as it turns out, API’s are exactly like user interfaces and you are very familiar with your typical user interface. That’s on your smartphone. This interface is designed for a human to use.
It’s a user interface and end-user like a human. Well, API’s are really the exact same thing. As a user interface, except, it’s for an entirely different user. It’s not for a human being. It’s for a machine. It’s for something like a software application running on a computer to be able to access the same information, the same way you might access it on your smartphone. Only it’s designed, so the machine can do it instead. So, what we are telling you is that the machine that’s actually going through an API which may be on the network. That’s why we have the cloud on the slide (any slide related to API which you see in the presentations).
It could be your smartphone accessing a server across the network, it could be a smartphone accessing google.com or blognxt.com. On the other hand, it could be two servers talking to each other maybe you have something like API talking through the network to blognxt.com to exchange some information through these network table APIs. Now, an API is a contract that exists between the two ends of the transaction. Right? And we want to get some terminology really clear here. We talk about APIs in terms of consumers and providers.
If you are a developer, building an application and you are going to use an API, that’s out on the internet and incorporate it into your application. You are considered the consumer of the API. The consuming developer, you are the API consumer. But if you are an organization like Google, which is putting an API onto the internet, so the developers can consume it, for example, the Google Maps API. Then you are the API provider. Very important terminology to understand because, throughout this series of videos, we will be talking about both consumers, baby eyes and providers of APIs. Now, why would anybody do this? What’s so cool about it?
Well, as it turns out, if you are an Application Developer, you can outsource certain requirements of your application to an API. So, going back to that example of using Google Maps instead of writing all the code, you would need to paint a map in your application. You can actually just outsource all of that with one line of code to the Google Maps API. So it’s a really good example of how you might outsource some sort of functionality in your application.
Another example might be a patient record, maybe on a mobile application. You have an app that can access your own patient portal and you might want to look at the results of your last medical visit to the hospital or to your doctor’s office. So, you can look at the patient record, you can look at a location as a PIN represented on a map, very often you see that happening in some applications.
Where they have the Google Maps, functionality built right into them and a little pin shows up at the location that you are either standing at or that you are going to go to or you might want to execute a financial transaction through an API. There are standard APIs for things like PayPal or other websites that can make financial transactions. Now, for this to happen, there has to be a technical contract that exists between the two parties. A very exciting understanding between the Application that’s consuming the API and the API provider.
This is imperative because of that understand, is not exact and it is not followed to the T. Then the actual API transaction will breakdown. It’s kind of like a legal contract if you think about – like famous sports players who plays for some team. A soccer team or a football team. He or she has to sit down and sign a legal contract and then both parties are bound to certain performance. By that contract, the player must behave a certain way in the field must deliver certain performance on the field. And the organization must pay the player a certain amount of money for that performance, behaviour.
These are very exacting terms and an API is no different. There is a contract that exists between the consumer of the API and the provider of the API and the way that performance of both is required, the contract usually represents some agreed-upon standards on exactly how the information or the functionality like drawing a map and putting a pint on it is going to be exchanged. Somethings, it involves standards, no standards could be – standards like the ones that are set by the W3C or they could be de facto standards.
The ones that are set maybe by a bunch of players in an industry right now. In the next part of this article or guide, you will learn about some real-world angles that will help you to better understand just how it is that API do what they do? This is a beginner to intermediate level guide, we don’t do a real serious technical deep dive or cover all of the technical details here. But, we give you just enough to get smart about them. So, just again to review what the series is covering and broad brush, we are talking about what exactly an API is.
How do they work, talking about why it is you should invest an API program. Whether you are a developer or an API provider, it’s a very important issue. You want to treat them like a product. How to secure them because generally speaking API’s go on the internet and internet security is very important for everybody. Why API first design is so important? API first design is a methodology towards building the best API. So that developers will really love using them and finally, lastly we are going to put our hands on. And get some real examples of building an API. And, then how to consume them. How we talked about API is a user interface.
That we are all used to using for example on our smartphone looks like this. We all know what do do with this, we can see it, we can touch it, we can feel it, we can look, use the menus, we have an expectation of how it works. Our brains know how to work with these good machines need their own interface. They don’t have brains, they don’t have fingers, they don’t have eyes, they need their own understanding of how to talk to each other. That understanding is what we call a contract, talked about that in the previous chunk of this article one.
But next, we will be discussing a little bit more about the different analogies in the real world. That look just like an API contract and those analogies are going to be using a wall socket, using Lego and then using what we call the intermodal shipping container. Which, all of you may have seen on cargo ships or on rail cars, on the back of tractor-trailer trucks. So, let’s talk about the contract that exists with a wall socket. Well, a really good example of where are they consumed by the service providers of the service just like with APIs. Consumers and providers we talked about that in the begging of this article. Of course, as a device, it could be a computer, it could be a hair dryer, it could be a television. The provider is your electric utility and the wall socket is a really good example of where the interface is.
The two can work with each other, it’s a very basic but exact technical understanding. You have got a specific arrangement of the receptacles in the wall socket. The tall receptacle is for neutral, the short ones for hot, the semi ovular one is for the ground. It delivers 120 volts of alternating current as opposed to direct current and those different hols are a very specific distance apart from one another. So there’s very clear contract here that exists. So that, no matter what it is, that you have, you can plug it into the wall and it really doesn’t know what’s providing electricity. Just so long as that thing that’s providing the electricity. It also adheres to this particular contract.
Another great example is Lego. We have all played with it, we have kids that play with it and for Lego to Snap to each other, you would need to have a very exact understanding of the dimensions of the different stubs and nubs on the Legos and how they fit together. The consumer may be the one that goes on top and the provider may be the one that goes on the bottom. But, at the end of the day, there’s a technical contract that exists between all LEGO pieces. Now our favourite is the intermodal shipping container developed by a guy named Malcolm, McLean who’s considered to be the father of modern-day shipping logistics.
So he looked back at this and a long time ago in the middle of the 20th century, and he said that is really inefficient for us to be handloading cargo onto a ship and then unloading it by hand on the other end. And, then splitting it up and figuring out well which goes to that store, which goes to that recipient etc. He came up with a much better way called the intermodal shipping container and the idea behind that is to say – we are going to take all these goods, we are going to put in them a shipping container on a truck, we are going to drive that truck to the railway station.
We are going to put it on a rail car that rail car is going to the shipping yard, then we are going to put it into a cargo ship. And, thus, then we are going to ship it and on the other end, that same process is going to go in reverse until the cargo container arrives at the recipient’s location. And, they unloaded. You can imagine how compared to the old way of just handloading, all the different cargo, it was way more of an efficient process. He came up with this whole idea and it’s very much based on a contract that it happens where these containers connect to everything to each other to rail cars – to tractor-trailer trucks or even to the cargo ships.
So, for example, if you look at the exact model from the Google Image, you can see that on all four corners of the container. There’s what’s called the twist-lock receptacle. You have got the actual twist, lock assembly and these have very specific dimensions to them. So, they call can fit together, almost like Lego fits together and these dimensions are really well understood.
Whether it be just the containers themselves, the cargo ships, the rail cars or the tractor-trailer trucks. So, as an example of the contract here, again the size of the cargo container 40 feet by 8 foot by 6 by 8. The twist-lock casting which appears on all eight corners of the shipping. And, then there come the assemblies which are many a time a single-sided and other times are double-sided trailer-mounted rail. Mounted cargo ship mounts, it doesn’t matter, they all understand this and then you add again to have this idea of a provider and a consumer, the provider is the provider of the transportation, the real car the cargo ship the tractor-trailer truck.
So think about it, what out there in the real world is another analogy for this sort of contract that exists between a consumer and a provider or something we are literally surrounded by thousands of these analogies. We see them every single day. So, stop and think about it in your mind so that when you are having that conversation with somebody and you are trying to explain API to them, pick something that you understand really well. And, then describe the contract to them, so that they get it there’s so many of these analogies out there, you just have to pick one. We take APIs, we put them on a network and then the security and internet security or of paramount concern. What is API first design in methodology and why is it so important for you?
When you are building your API, and lastly we are going to put our hands-on and we are going to build some APIs and consume them in a way that you get a really good idea of how they work. Now, in this series, we have already talked about how APIs or a different kind of user interface, they are just four machines as opposed to the user interface that you are we are used to using.
When we work with computers whether that be a smartphone or a desktop, a desktop computer, a web computer, it doesn’t matter. On the top you have your consumers, you have a hairdryer, you have a computer, you have a Tesla, you have a toaster, they all conform to the contract when they are consuming electricity, they know exactly what it is. They need it from the wall socket to do what it is, they do now. On the other side of the wall socket is the provider of the service. This is the electric utility and here’s where the flexibility comes in. hairdryer
That electricity can be delivered from a coal-burning plant, from a nuclear plant, from wind from hydroelectric, it doesn’t matter. Consumers don’t know and don’t care, we call this decoupling. We are separating the concerns of the consumers and the providers in a way that they don’t have to know a whole lot about each other. hairdryer
They just have to conform to the contract in the middle and that’s very important when you think about flexibility. If you are the electric utility and you are looking for ways to drive down costs or do more for the environment, now you have some options that you can put in place while not disrupting your consumers who are using that electricity? Now, in the Lego World, we have a very specific contract that exists between the providers and consumers. The one that attaches to the other one and this makes it possible for you to attach anything, to anything just like you can connect any device to any source of electric power.
Also Read: How To Jailbreak Amazon Fire TV Stick?