API testing in the QA field is a very desired skill set and knowing how to do so only makes you more marketable and valuable in the field. But what does API testing entail?
I think we should first start off with what is an API.
What is an API?
API is an acronym that stands for application programming interface. It is a way for 2 or more computer programs to communicate with each other. APIs are a convenient way to share and receive data across different applications.
If you have a smartphone, there is a good chance that you use APIs all the time and don’t even know it. Mobile applications such as your banking application, use APIs to retrieve your bank information and send payments. The application connects to the internet and then sends information to a server. The server then receives the information performs the required actions, and then sends it back to your phone.
An API endpoint is a digital location where an API receives a request about a resource that exists on its server. Usually, an endpoint is a URL or uniform resource locator, that provides the location of the resource on the server. Now that we have a basic high-level idea about APIs, let’s discuss how to test them
API testing involves analyzing an API to confirm that it meets the expected functionality, reliability, security, and performance. This type of testing focuses on the business logic, security, and data responses of the application. API testing is usually carried out by making a request or call to 1 or more API endpoints and then comparing the response with the expected results. API testing can be done via automation or manual QA testing.
Approaching API Testing
When doing API testing you want to first find the scope and flows of the application. Then think about the expected responses for successful and unsuccessful requests being made to endpoints. Once this is decided a test plan and test cases can be written that cover things such as the response time from the endpoint, authorization, HTTP status codes, and error codes.
Types of API Testing