API Content
API Content
• All Web services are APIs but not all APIs are Web services.
• A Web service always needs a network to operate while APIs don’t need a
network for operation. API’s can be tested on local machine
API testing is a kind of software testing which determines if the developed APIs
meet expectations regarding the functionality, reliability, performance, and
security of the application.
What is the procedure to perform API testing and what exactly needs to be
checked?
During the API testing process, a request is raised to the API with the known
data. This way you can analyze the validation response. Basically, things that
must be checked during performing API testing are:
1. Accuracy of data
2. Schema validation
3. HTTP status codes
4. Data type, validations, order, and completeness
5. Authorization checks
6. Implementation of response timeout
7. Error codes in case API returns, and
8. Non-functional testing like performance and security testing
Name the common protocols used in API testing.
Many protocols are there that can be used in API testing. These are as follows:
There are many testing tools available that can be used for API testing. A few
of them are:
The term REST refers to Representational State Transfer. In a very short span
of time, it has become an effective standard for API creation.
What is SOAP?
The term SOAP refers to Simple Object Access Control. In simple terms, it is
an XML-based protocol that helps in exchanging information among
computers.
SOAP REST
What’s the difference between PUT and POST operations in Rest API?
PUT POST
If the PUT request is used more than one time, If a POST request is used multiple times, the
the results will remain the same. results will be different.
PUT or POST are used for creating resources. GET is used only for requesting
data from a specified resource
Yes, we can because POST is the superset of all HTTP requests except GET
requests.
Explain the major challenges that come while API testing.
The list of major challenges that come while API testing is:
1. Parameter Combination
2. Parameter Selection and
3. Call Sequencing
Explain the types of bugs that can be found using API testing?
1. Stress
2. Security
3. Duplicate or missing functionality
4. Reliability
5. Unused flags
6. Incompatible error handling
7. Multi-threaded issues, and
8. Improper errors
List some templates for API documentation that are most used.
There are various API documentation templates that are making the whole
process really simple and easy. Check them below:
1. Swagger
2. Miredot
3. Slate
4. FlatDoc
5. API blueprint
6. RestDoc
7. Web service API specification
What are differences between API Testing and Unit Testing?
201 (Created) The value wrapped with the request has been created in the
database.
204(No Content) This status code means that the request was correct and
received but there is no response to send to the client by the server.
400 (Bad Request) A bad request means that the syntax of the request was
incorrect. It can happen if you have sent the wrong parameters along with the
request URL or in the body of the request.
401 (Authorized) We can incur such a status code when you are not
authorized to access the server or you have entered the wrong credentials.
404 (Not Found) A response code 404 means that the server was connected
but it could not find what was requested. You can normally see this status code
when you request a web page that is not available.
500(Internal Server Error) A response code 500 means there was some
exception at the server level while executing the request.
504(Gateway Timeout) The server, while acting as a gateway or proxy, did not
receive a timely response from the upstream server specified by the URI
Uniform Resource Identifier, URI consists of base URL, path parameter, and
query parameter
URI- https://reqres.in/api/users?page=2
HTTP defines these standard status codes that can be used to convey the
results of a client’s request. The status codes are divided into the five
categories.
API Status Codes - Getting Started - API Docs - BigCommerce Dev Center -
Theme Development & API Documentation