0% found this document useful (0 votes)
42 views10 pages

What Is API 1700933836

This document discusses APIs, web services, REST, and API testing. It defines an API as an interface that allows communication between different software components or systems. A web service is an API that uses a network, while an API can be online or offline. REST is an architectural style for designing APIs that uses six main principles. API testing works on the business layer and allows testing without a finished UI by hitting API endpoints to test data transfer and storage. Common API methods like GET, PUT, POST, and DELETE are used for retrieving, updating, creating, and deleting data.

Uploaded by

Vamshi Krishna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views10 pages

What Is API 1700933836

This document discusses APIs, web services, REST, and API testing. It defines an API as an interface that allows communication between different software components or systems. A web service is an API that uses a network, while an API can be online or offline. REST is an architectural style for designing APIs that uses six main principles. API testing works on the business layer and allows testing without a finished UI by hitting API endpoints to test data transfer and storage. Common API methods like GET, PUT, POST, and DELETE are used for retrieving, updating, creating, and deleting data.

Uploaded by

Vamshi Krishna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

What is API & WebServices?

What is REST?
What is API Testing?

Guide by: Japneet Sachdeva

Japneet Sachdeva
What is API?

API - Application Programming Interface -

Basic use is to carry data from

Servers (database) to Client (user-interface).

So it means you can carry data from backend and populate it to your front-end.

Japneet Sachdeva
Difference in webservice and api?

Every web service is an API — since it exposes an application’s data and/or


functionality — but not every API is a web service.

Web services require a network. While APIs can be on- or offline, web services
must use a network.

● Example 1 - Webservice/API being used when you use Google authentication


etc.
● Example 2 - Selenium jars, apache poi jars etc. that we use in our projects for
creating frameworks, are actual API, because we are not using any network
for interactions. So it cannot be a webservice.
Japneet Sachdeva
Basics of REST API

REST - Representational State Transfer Protocol

REST - is architectural design pattern which is used to design API. It makes API to
follow 6 main principles:-
1) Uniform interface
2) Statelessness
3) Layered system
4) Cacheability
5) Code on demand (Optional)
6) Client Server

Not necessary to learn these just remember these principles

Japneet Sachdeva
How API testing works?

API testing works on business layer. Now what is business layer?

Example - Searching for a product on Amazon - then the product searched by user
- A list of products will be showcased. So how is it done?

This is where business logic works! It helps compute data based on user actions.
So to perform this there are many ways like WebSockets, Polling, TCP connections
(API).

Japneet Sachdeva
Why API testing is required?

● API contracts are designed for this process - which helps how data is stored
(like JSON, XML, Form-Data etc.). Using these API contracts we can start
building our assertions/tests to make sure data displayed and stored is
working correctly.
● We as testers don't require UI to be finished so that we can start testing. We
just need Backend setup or sometimes we don't even require backend setup
as well because once we have API contracts.
● Once the environment is setup by backend dev team then we just need to hit
our requests on there servers and Boom we are ready to test. This form of
testing we can call as unit-testing.
Japneet Sachdeva
API basic architecture

Japneet Sachdeva
Basic REST API methods used in API testing

● GET - Helps to retrieve data from source (server). Not necessarily require a
request body. After request completes response is received.
● PUT - Helps to update data in the source (server). Requires Request body and
provides response once request completed.
● POST - Helps to create data in the source (server). Requires Request body and
provides response once request completed. POST request is parent of all the
request types so it can be used instead of GET, PUT, DELETE etc.
● DELETE - Helps to permanently remove data from source (server). It can work
with & without request body. Response is received once request completed.
Japneet Sachdeva
API terminologies in sync with database testing

Japneet Sachdeva
Practice API Testing using below website

API Testing practice website.

Use Postman tool to practice basic GET, PUT, POST and DELETE requests.

In upcoming posts I’ll be providing complete understanding of POSTMAN tool so


keep following @Japneet Sachdeva on LinkedIn

Japneet Sachdeva

You might also like