0% found this document useful (0 votes)
10 views

API Cheet Sheet

The document is an API Cheat Sheet outlining common API test cases, including response validation, request validation, error handling, success handling, and negative scenarios. It also details types of authentication methods and the structure of API requests, including HTTP methods, headers, parameters, and request body. The cheat sheet serves as a quick reference for developers and testers to ensure proper API functionality and security.

Uploaded by

palranjeet2512
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)
10 views

API Cheet Sheet

The document is an API Cheat Sheet outlining common API test cases, including response validation, request validation, error handling, success handling, and negative scenarios. It also details types of authentication methods and the structure of API requests, including HTTP methods, headers, parameters, and request body. The cheat sheet serves as a quick reference for developers and testers to ensure proper API functionality and security.

Uploaded by

palranjeet2512
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/ 11

01/12

API Cheat Sheet

alphabin.co
Debug with Shubbham
02/12

Common API Test Cases


1. Response Validation
Verify that the API response status code is 200 OK
upon successful request
Verify that the API response is in the expected
format (e.g. JSON, XML)
Verify that the API response contains all the
expected fields
Verify that the API response contains the correct
data for each field
03/12

Verify that the API response time is within


acceptable limits
Verify that the API response headers are correct.
Verify that the API response contains a specific error
message when the request fails due to validation
errors
Verify that the API response contains a specific error
message when the request fails due to server-side
errors

alphabin.co
Debug with Shubham
04/12

2. Request Validation
Verify that the API request parameters are correctly
passed to the API
Verify that the API request method is correct (e.g.,
GET, POST, PUT, DELETE)
Verify that the API endpoint URL is correct
Verify API response headers is correct
Verify API returns error message for missing request
payload
Verify API returns error message for missing API
request method

alphabin.co
Debug with Shubham
05/12

3. Error Handling
Verify API returns error message for forbidden
access
Verify API returns error message for server-side
validation failure
Verify API returns error message for invalid
authentication credentials
Verify API returns a specific error message for invalid
data format in request
Verify API returns error message and status code for
invalid authentication credentials

alphabin.co
Debug with Shubham
06/12

4. Success Handling
Verify that the API returns a success message if the
resource is created successfully
Verify that the API returns a success message if the
resource is updated successfully
Verify that the API returns a success message if the
resource is deleted successfully
Verify that the API returns a success message if the
resource is retrieved successfully
Verify that the API returns a success message if the
resource is retrieved successfully

alphabin.co
Debug with Shubham
07/12

5. Negative Scenarios
Verify API response for invalid request method
Verify API response for exceeded payload size
Verify API response for malformed request URL
Verify API response for non-existent resource
Verify API response for expired authentication token
Verify API response for incorrect content type
Verify API response for unexpected server errors
Verify API response for invalid authentication
credentials

alphabin.co
Debug with Shubham
08/12

Types of Authentication
1. Basic Authentication
2. Pre-emptive Authentication
3. Digest Authentication
4. OAuth2 Authentication
5. OAuth Authentication

alphabin.co
Debug with Shubham
09/12

Request Structure
1. HTTP Method
GET
POST
PUT
DELETE
PATCH

alphabin.co
Debug with Shubham
10/12

3. Request Header
Content-Type
Authorization
Accept

4. Request Parameters
Query Parameters
Path Parameters
Request Body

alphabin.co
Debug with Shubham
11/12

5. Request Body
For HTTP methods like POST, PUT, and PATCH, the
request body contains the data that the client wants
to send to the server.

6. Authentication
If the API requires authentication, the client must
include authentication credentials (e.g., API keys,
OAuth tokens)

alphabin.co
Debug with Shubham

You might also like