SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Hello Everyone
WHAT IS API
API stands for Application Programming Interface.
They are basically collection of functions and procedures, which allow us to communicate two
application or libraries.
API is an interface between programs and services
At the most basic level, an API is a mechanism that enables an application or service to access a
resource within another application or service. The application or service doing the accessing is called
the client, and the application or service containing the resource is called the server.
How API Works
 Let’s use a simple laymen example to explain how an API works.
 Imagine you’re a customer at a restaurant. The waiter (the API) functions as an
intermediary between customers like you (the user) and the kitchen (web server).
You tell the waiter your order (API call), and the waiter requests it from the kitchen.
Finally, the waiter will provide you with what you ordered.
The waiter is the intermediary between you and the kitchen. In this metaphor, the
waiter is effectively an abstraction of the API.
WHAT IS API TESTING
 API Testing is testing that API’s and its integration with the services.
 It is one of the most challenging types of testing. If we miss the certain cases in API
testing then it will cause a very big problem in production environment. And it is
very to debug in production environment.
 API testing involves testing the collection of APIs and checking if they meet
expectations for functionality, reliability, performance, and security and returns the
correct response.
Why We Perform API Testing
 Many of the services that we use everyday rely on different interconnected API’s. If
any of them fail then services will not work.
 API testing is used to determine whether the output is well-structured and useful to
another application or not, checks the response on basis of input (request)
parameter, and checks how much time the API is taking to retrieve and authorize
the data too.
 Developer sometimes make mistake and created defective API’s.
 Validation of API is very important.
Role of Tester in API Testing
 Validate the keys with the minimum and maximum range.
 Has to perform XML, JSON, etc, schema or syntax validation.
 Verify the Response status code with the API document.
 Verify the error codes and messages.
 Verify each key and their expected values.
 Create documentation for their tested API’s.
 If any bug is found then they have to create a Defect for the issue.
Types of API
 REST
 SOAP
 JSON RPC
 XML RPC
REST is mostly used then followed by SOAP.
REST API
 Some APIs, such as SOAP or XML-RPC, impose a strict framework on developers. But REST APIs can
be developed using virtually any programming language and support a variety of data formats. The
only requirement is that they align to the following six REST design principles - also known as
architectural constraints:
 Uniform interface. All API requests for the same resource should look the same, no matter where
the request comes from. The REST API should ensure that the same piece of data, such as the name
or email address of a user, belongs to only one uniform resource identifier (URI). Resources
shouldn’t be too large but should contain every piece of information that the client might need.
 Client-server decoupling. In REST API design, client and server applications must be completely
independent of each other. The only information the client application should know is the URI of
the requested resource; it can't interact with the server application in any other ways. Similarly, a
server application shouldn't modify the client application other than passing it to the requested
data via HTTP.
 Statelessness. REST APIs are stateless, meaning that each request needs to include all the
information necessary for processing it. In other words, REST APIs do not require any server-side
sessions. Server applications aren’t allowed to store any data related to a client request.
 Cacheability. When possible, resources should be cacheable on the client or server side. Server
responses also need to contain information about whether caching is allowed for the delivered
resource. The goal is to improve performance on the client side, while increasing scalability on the
server side.
 Layered system architecture. In REST APIs, the calls and responses go through different layers. As a
rule of thumb, don’t assume that the client and server applications connect directly to each other.
There may be a number of different intermediaries in the communication loop. REST APIs need to
be designed so that neither the client nor the server can tell whether it communicates with the end
application or an intermediary.
 Code on demand (optional). REST APIs usually send static resources, but in certain cases, responses
can also contain executable code (such as Java applets). In these cases, the code should only run
on-demand.
How REST APIs work
 REST APIs communicate via HTTP requests to perform standard database functions
like creating, reading, updating, and deleting records (also known as CRUD) within
a resource. For example, a REST API would use a GET request to retrieve a record, a
POST request to create one, a PUT request to update a record, and a DELETE
request to delete one. All HTTP methods can be used in API calls. A well-designed
REST API is similar to a website running in a web browser with built-in HTTP
functionality.
 The state of a resource at any particular instant, or timestamp, is known as the
resource representation. This information can be delivered to a client in virtually
any format including JavaScript Object Notation (JSON), HTML, XLT, Python, PHP, or
plain text. JSON is popular because it’s readable by both humans and machines—
and it is programming language-agnostic.
Difference b/w REST and SOAP
Sr. No. Key REST API SOAP API
1
Implementation Rest API is implemented as it has no official
standard at all because it is an architectural style.
On other hand SOAP API has an official
standard because it is a protocol.
2
Internal
communication
REST APIs uses multiple standards like HTTP,
JSON, URL, and XML for data communication and
transfer.
SOAP APIs is largely based and uses only HTTP
and XML.
3
Resource
requirement
As REST API deploys and uses multiple standards
as stated above, so it takes fewer resources and
bandwidth as compared to SOAP API.
On other hand Soap API requires more resource
and bandwidth as it needs to convert the data
in XML which increases its payload and results
in the large sized file.
4
Description REST API uses Web Application Description
Language for describing the functionalities being
offered by web services.
On other hand SOAP API used Web Services
Description language for the same.
5
Security REST has SSL and HTTPS for security. On other hand SOAP has SSL( Secure Socket
Layer) and WS-security due to which in the
cases like Bank Account Password, Card
Number, etc. SOAP is preferred over REST.
HTTP METHODS
1 GET
The GET method is used to retrieve information from the given server using a given URI. Requests
using GET should only retrieve data and should have no other effect on the data.
2 HEAD
Same as GET, but transfers the status line and header section only.
3 POST
A POST request is used to send data to the server, for example, customer information, file upload,
etc. using HTML forms.
4 PUT
Replaces all current representations of the target resource with the uploaded content.
5 DELETE
Removes all current representations of the target resource given by a URI.
6 CONNECT
Establishes a tunnel to the server identified by a given URI.
7 OPTIONS
Describes the communication options for the target resource.
8 TRACE
Performs a message loop-back test along the path to the target resource.
HTTP Status Codes
S.N. Code and Description
1 1xx: Information
It means the request has been received and the process is continuing.
2 2xx: Success
It means the action was successfully received, understood, and accepted.
3 3xx: Redirection
It means further action must be taken in order to complete the request.
4 4xx: Client Error
It means the request contains incorrect syntax or cannot be fulfilled.
5 5xx: Server Error
It means the server failed to fulfill an apparently valid request.
What is Postman
 Postman is a collaboration platform for API development. It is a popular API client
and it enables you to design, build, share, test, and document APIs.
 Using the Postman tool, we can send HTTP/s requests to a service, as well as get
their responses. By doing this we can make sure that the service is up and running.
 Being originally a Chrome browser plugin, Postman now extends their solution with
the native version for both Mac and Windows.
 A test in Postman is fundamentally a JavaScript code, which run after a request is
sent and a response has been received from the server
Why Postman
 Postman has become a tool of choice for over 8 million users.
 Free: It is free to download and use for teams of any size.
 Easy: Just download it and send your first request in minutes.
 APIs Support: You can make any kind of API call (REST, SOAP, or plain HTTP) and
easily inspect even the largest responses.
 Extensible: You can customize it for your needs with the Postman API.
 Integration: You can easily integrate test suites into your preferred CI/CD service
with Newman (command line collection runner)
 Community & Support: It has a huge community forum
Postman Features
 Easy-to-use REST client
 Rich interface which makes it easy to use
 Can be used for both manual and automated API testing
 Can be run on Mac, Windows, Linux & Chrome Apps
 Has a bunch of integrations like support for Swagger & RAML formats
 Has Run, Test, Document and Monitoring Features
 Doesn’t require learning a new language
 Enable users to easily share the knowledge with the team as they can package up all the
requests and expected responses, then send to their colleagues.
 Can be integrated with CI-CD tools like Jenkins, TeamCity etc.,
 Comes with a detailed API documentation
 API development & Automating API tests execution

Weitere ähnliche Inhalte

Ähnlich wie Apitesting.pptx

Session 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfSession 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfEngmohammedAlzared
 
Introduction to API
Introduction to APIIntroduction to API
Introduction to APIrajnishjha29
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Jackson F. de A. Mafra
 
zendframework2 restful
zendframework2 restfulzendframework2 restful
zendframework2 restfultom_li
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfAparna Sharma
 
Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Vibhawa Nirmal
 
A Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API TestingA Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API TestingpCloudy
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST APIstephenbhadran
 

Ähnlich wie Apitesting.pptx (20)

Rest web service
Rest web serviceRest web service
Rest web service
 
Session 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfSession 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdf
 
Introduction to API
Introduction to APIIntroduction to API
Introduction to API
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015
 
zendframework2 restful
zendframework2 restfulzendframework2 restful
zendframework2 restful
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdf
 
ReSTful API Final
ReSTful API FinalReSTful API Final
ReSTful API Final
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface) Introduction to APIs (Application Programming Interface)
Introduction to APIs (Application Programming Interface)
 
Best Practices in Api Design
Best Practices in Api DesignBest Practices in Api Design
Best Practices in Api Design
 
Rest api-interview
Rest api-interviewRest api-interview
Rest api-interview
 
Switch to Backend 2023 | Day 1 Part 1
Switch to Backend 2023 | Day 1 Part 1Switch to Backend 2023 | Day 1 Part 1
Switch to Backend 2023 | Day 1 Part 1
 
A Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API TestingA Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API Testing
 
API Basics
API BasicsAPI Basics
API Basics
 
LAJUG Napster REST API
LAJUG Napster REST APILAJUG Napster REST API
LAJUG Napster REST API
 
C# REST API
C# REST APIC# REST API
C# REST API
 
Salesforce REST API
Salesforce  REST API Salesforce  REST API
Salesforce REST API
 
Web 7 | HTTP Request and Response
Web 7 | HTTP Request and ResponseWeb 7 | HTTP Request and Response
Web 7 | HTTP Request and Response
 
Day03 api
Day03   apiDay03   api
Day03 api
 
Api 101
Api 101Api 101
Api 101
 

Kürzlich hochgeladen

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 

Kürzlich hochgeladen (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

Apitesting.pptx

  • 2. WHAT IS API API stands for Application Programming Interface. They are basically collection of functions and procedures, which allow us to communicate two application or libraries. API is an interface between programs and services At the most basic level, an API is a mechanism that enables an application or service to access a resource within another application or service. The application or service doing the accessing is called the client, and the application or service containing the resource is called the server.
  • 3. How API Works  Let’s use a simple laymen example to explain how an API works.  Imagine you’re a customer at a restaurant. The waiter (the API) functions as an intermediary between customers like you (the user) and the kitchen (web server). You tell the waiter your order (API call), and the waiter requests it from the kitchen. Finally, the waiter will provide you with what you ordered. The waiter is the intermediary between you and the kitchen. In this metaphor, the waiter is effectively an abstraction of the API.
  • 4. WHAT IS API TESTING  API Testing is testing that API’s and its integration with the services.  It is one of the most challenging types of testing. If we miss the certain cases in API testing then it will cause a very big problem in production environment. And it is very to debug in production environment.  API testing involves testing the collection of APIs and checking if they meet expectations for functionality, reliability, performance, and security and returns the correct response.
  • 5. Why We Perform API Testing  Many of the services that we use everyday rely on different interconnected API’s. If any of them fail then services will not work.  API testing is used to determine whether the output is well-structured and useful to another application or not, checks the response on basis of input (request) parameter, and checks how much time the API is taking to retrieve and authorize the data too.  Developer sometimes make mistake and created defective API’s.  Validation of API is very important.
  • 6. Role of Tester in API Testing  Validate the keys with the minimum and maximum range.  Has to perform XML, JSON, etc, schema or syntax validation.  Verify the Response status code with the API document.  Verify the error codes and messages.  Verify each key and their expected values.  Create documentation for their tested API’s.  If any bug is found then they have to create a Defect for the issue.
  • 7. Types of API  REST  SOAP  JSON RPC  XML RPC REST is mostly used then followed by SOAP.
  • 8. REST API  Some APIs, such as SOAP or XML-RPC, impose a strict framework on developers. But REST APIs can be developed using virtually any programming language and support a variety of data formats. The only requirement is that they align to the following six REST design principles - also known as architectural constraints:  Uniform interface. All API requests for the same resource should look the same, no matter where the request comes from. The REST API should ensure that the same piece of data, such as the name or email address of a user, belongs to only one uniform resource identifier (URI). Resources shouldn’t be too large but should contain every piece of information that the client might need.  Client-server decoupling. In REST API design, client and server applications must be completely independent of each other. The only information the client application should know is the URI of the requested resource; it can't interact with the server application in any other ways. Similarly, a server application shouldn't modify the client application other than passing it to the requested data via HTTP.
  • 9.  Statelessness. REST APIs are stateless, meaning that each request needs to include all the information necessary for processing it. In other words, REST APIs do not require any server-side sessions. Server applications aren’t allowed to store any data related to a client request.  Cacheability. When possible, resources should be cacheable on the client or server side. Server responses also need to contain information about whether caching is allowed for the delivered resource. The goal is to improve performance on the client side, while increasing scalability on the server side.  Layered system architecture. In REST APIs, the calls and responses go through different layers. As a rule of thumb, don’t assume that the client and server applications connect directly to each other. There may be a number of different intermediaries in the communication loop. REST APIs need to be designed so that neither the client nor the server can tell whether it communicates with the end application or an intermediary.  Code on demand (optional). REST APIs usually send static resources, but in certain cases, responses can also contain executable code (such as Java applets). In these cases, the code should only run on-demand.
  • 10. How REST APIs work  REST APIs communicate via HTTP requests to perform standard database functions like creating, reading, updating, and deleting records (also known as CRUD) within a resource. For example, a REST API would use a GET request to retrieve a record, a POST request to create one, a PUT request to update a record, and a DELETE request to delete one. All HTTP methods can be used in API calls. A well-designed REST API is similar to a website running in a web browser with built-in HTTP functionality.  The state of a resource at any particular instant, or timestamp, is known as the resource representation. This information can be delivered to a client in virtually any format including JavaScript Object Notation (JSON), HTML, XLT, Python, PHP, or plain text. JSON is popular because it’s readable by both humans and machines— and it is programming language-agnostic.
  • 11. Difference b/w REST and SOAP Sr. No. Key REST API SOAP API 1 Implementation Rest API is implemented as it has no official standard at all because it is an architectural style. On other hand SOAP API has an official standard because it is a protocol. 2 Internal communication REST APIs uses multiple standards like HTTP, JSON, URL, and XML for data communication and transfer. SOAP APIs is largely based and uses only HTTP and XML. 3 Resource requirement As REST API deploys and uses multiple standards as stated above, so it takes fewer resources and bandwidth as compared to SOAP API. On other hand Soap API requires more resource and bandwidth as it needs to convert the data in XML which increases its payload and results in the large sized file. 4 Description REST API uses Web Application Description Language for describing the functionalities being offered by web services. On other hand SOAP API used Web Services Description language for the same. 5 Security REST has SSL and HTTPS for security. On other hand SOAP has SSL( Secure Socket Layer) and WS-security due to which in the cases like Bank Account Password, Card Number, etc. SOAP is preferred over REST.
  • 12. HTTP METHODS 1 GET The GET method is used to retrieve information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data. 2 HEAD Same as GET, but transfers the status line and header section only. 3 POST A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms. 4 PUT Replaces all current representations of the target resource with the uploaded content. 5 DELETE Removes all current representations of the target resource given by a URI. 6 CONNECT Establishes a tunnel to the server identified by a given URI. 7 OPTIONS Describes the communication options for the target resource. 8 TRACE Performs a message loop-back test along the path to the target resource.
  • 13. HTTP Status Codes S.N. Code and Description 1 1xx: Information It means the request has been received and the process is continuing. 2 2xx: Success It means the action was successfully received, understood, and accepted. 3 3xx: Redirection It means further action must be taken in order to complete the request. 4 4xx: Client Error It means the request contains incorrect syntax or cannot be fulfilled. 5 5xx: Server Error It means the server failed to fulfill an apparently valid request.
  • 14. What is Postman  Postman is a collaboration platform for API development. It is a popular API client and it enables you to design, build, share, test, and document APIs.  Using the Postman tool, we can send HTTP/s requests to a service, as well as get their responses. By doing this we can make sure that the service is up and running.  Being originally a Chrome browser plugin, Postman now extends their solution with the native version for both Mac and Windows.  A test in Postman is fundamentally a JavaScript code, which run after a request is sent and a response has been received from the server
  • 15. Why Postman  Postman has become a tool of choice for over 8 million users.  Free: It is free to download and use for teams of any size.  Easy: Just download it and send your first request in minutes.  APIs Support: You can make any kind of API call (REST, SOAP, or plain HTTP) and easily inspect even the largest responses.  Extensible: You can customize it for your needs with the Postman API.  Integration: You can easily integrate test suites into your preferred CI/CD service with Newman (command line collection runner)  Community & Support: It has a huge community forum
  • 16. Postman Features  Easy-to-use REST client  Rich interface which makes it easy to use  Can be used for both manual and automated API testing  Can be run on Mac, Windows, Linux & Chrome Apps  Has a bunch of integrations like support for Swagger & RAML formats  Has Run, Test, Document and Monitoring Features  Doesn’t require learning a new language  Enable users to easily share the knowledge with the team as they can package up all the requests and expected responses, then send to their colleagues.  Can be integrated with CI-CD tools like Jenkins, TeamCity etc.,  Comes with a detailed API documentation  API development & Automating API tests execution