Surely you have ever heard the word “API”, because in recent years this concept has revolutionized the way of programming on the Internet and the communication between systems, programs, websites, etc.An API (Application Programming Interface) is the interface that a software uses to interact with other software. All the programming languages bring an API that allows us to manipulate files, create concurrent applications, use the network and work with collections (fixes, maps, sets, etc.), among others, as advised on stoplight.io site.
A Web API is an API that is invoked through the HTTP protocol. The advantage of using HTTP is that it is possible to make requests from any programming language, which makes the Web an ideal way to connect applications.It is possible to find Web APIs for almost anything: knowing the weather, exchange rates, sending emails, receiving payments, among thousands of other examples.
How does a Web API work
When you enter a Web address (URL) from a browser, the browser sends an HTTP request to the server, which responds with HTML code. An HTTP request is made (usually from a programming language), but instead of returning an HTML page, the server returns the information in an easy to manipulate representation in a programming language. Few years ago the preferred format among programmers to exchange information was XML (Extensible Markup Language) but today JSON is much more popular. The same can be expressed in both formats, but JSON is much simpler.
Web APIs, REST API’s or Web Services? Currently there is a lot of confusion between these three terms. REST API’s and Web Services are two specific forms of Web API’s. The name Web Services is very unfortunate because it is very generic and creates confusion. The reality is that Web Services is a group of very specific technologies to integrate applications using XML and SOAP (Simple Object Access Protocol).
REST derives its name from “Representational State Transfer”. Describes a particular style of API creation designed to be lightweight, easy to use and suitable for high volume services. Google, Facebook and Twitter use the REST approach for many of their APIs. One reason for this is because REST is based on HTTP. The REST API’s are linked to the HTTP protocol. The URL is used to define the resource and the HTTP verb to define the action we want to do on that resource.
A Web API is a special type of API that uses the HTTP protocol as transport. Currently REST API is the most popular form of Web API and is highly coupled to HTTP. That’s why it’s so important for a Web Developer to learn from the HTTP protocol. These are just some basics that any programmer or man who wants to base his career in IT needs to know. Technology is progressing every day and if you want to be successful in this field, you have to keep up with this progress, and these are just the initial steps.