All You Need to Know About API Testing 
Tags: softwaretesting, automationtesting, apitesting
Published: 2018-10-22 10:02:55

---
title: All You Need to Know About API Testing 
published: true
description: 
tags: software testing, automation testing, api testing,
---

##What is an API?
If you have already known, or if you have googled about, or if you are a little confused about what it says by looking all the technical terms over the Internet, just keep everything inside and the focus on what we are talking. So, API is nothing but it's an application program interface. As we already said the name itself says it is an interface.

##How does API Testing work?
It is all about requests and responses between the client and server. You want something, you request for something so there is a way it gets carried to the server and you get the response back from the server. In other words, it's all about your requesting and you know getting some responses from the provider.

##Real world examples
**_Example 1_**: Let's compare it with a real-world example: You go to a restaurant you sit at your table and you choose that you need ABC. You will have your waiter coming up and taking a note of what you want. You tell him that you want ABC. So, you are requesting ABC, the waiter responds back with ABC he gets in the kitchen and serves you the food. In this case, who is your interface in between you and the kitchen is your waiter. It's his responsibility to carry the request from you to the kitchen, make sure it's getting done, and you know once it is ready he gets back to you as a response.

**_Example 2_**: Another important example that we can relate is travel booking systems. For instance, take Kayak the biggest online site for booking tickets. You enter your destination, once you select dates and click on search, what you get back are the results from different airlines. How is Kayak communicating with all these airlines? There must be some ways that these airlines are actually exposing some level of information to Kayak. That's all the talking, it's through API's

**_Example 3_**: Now open UBER and see. Once the site is loaded, it gives you an ability to log in or continue with Facebook and Google. In this case, Google and Facebook are also exposing some level of users' information. There is an agreement between UBER and Google/Facebook that has already happened. That's the reason it is letting you sign up with Google/ Facebook.

 ![api testing introduction](https://i0.wp.com/testautomationresources.com/wp-content/uploads/2018/10/API-Testing-Uber-Example.png?w=951&ssl=1)

##What is the use of API's?
If I expose a free API, it's not that I am exposing all the information that there is. I have my own criteria like what level of information that I should expose to my user or to the outside world. So I tie that information and I just expose it, now people use it. Tomorrow, they want some extra level of information, they comfort me and ask me for that. Why should I give it for free? That's when I charge based on the demand, I do make money out of my extra services.

Think about the development perspective, UBER has an ability to share location where it uses Google Map API there. UBER has to focus on what it is actually doing rather than already existing functionality. It can just plug and play. There is no reinvestment of time to develop the same functionality. That's how people expose some level of API's to the outside world and some of them will be charged based on how you are using it.

##SOAP vs REST
SOAP has been used since many years ago but these days it's all about REST (Representational State Transfer). If you just go to any Job Portal and just click on 'REST API Automation Tester' or ''REST API Testing Jobs, there are tons out there.

REST is kind of API which is actually efficiently being used by many companies like eBay, Amazon, Google. When such big companies are using definitely they have already transitioned from SOAP to REST. It means that you know REST is in high demand now. There are few advantages from the development perspective, REST supports a number of data formats. The most important ones are the way the request is sent and how we read the response. There is a specific format SOAP always uses XML format whereas REST uses JASON. Now, because JASON is being used JavaScript object notation, it's a form of representation. If you click on a JASON format on Google, objects will be inverted commas followed by the parameters. So whatever, JASON is a way of our communication, a format which is being used for the information exchange such as request versus response.

More details about REST API Testing: [16 Common REST API Testing Interview Questions](https://testautomationresources.com/api-testing/rest-api-testing-interview-questions/)

##What to test in API's?
There is a huge need for us to make sure that what we are requesting and what we are getting are matched. If we are requesting for some information, we have to make sure that the response is correct. That's where QA/API testers come into the picture. It is our responsibility to make sure that every request is getting proper responses.

Learn more about available API Testing Tools: [SoapUI vs Postman, Katalon Studio: A Review of Top 3 API Tools](https://www.katalon.com/resources-center/blog/soapui-vs-postman-katalon-api-tools/)