\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Anu (AnuArun)} \pdfinfo{ /Title (a.pdf) /Creator (Cheatography) /Author (Anu (AnuArun)) /Subject (A Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{A Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Anu (AnuArun)} via \textcolor{DarkBackground}{\uline{cheatography.com/218568/cs/48343/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Anu (AnuArun) \\ \uline{cheatography.com/anuarun} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 2nd August, 2026.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{API Testing}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{API testing}} is the process of testing an Application Programming Interface (API) to validate its {\bf{functionality, reliability, security, and performance}}.} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Instead of testing the {\bf{User Interface (UI)}}, API testing is performed at the {\bf{application layer}} to verify how different applications or systems communicate with each other by sending requests and receiving responses.} \tn % Row Count 9 (+ 5) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Postman}} is one of the most widely used API testing tools that allows testers and developers to send API requests and validate the responses without using the application's user interface. It supports testing {\bf{REST and SOAP APIs}} and helps verify {\bf{response status codes, response body, response time, authentication, headers, and error handling}}.} \tn % Row Count 17 (+ 8) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Postman also allows requests to be organised into {\bf{collections}}, automated using {\bf{JavaScript test scripts}}, and integrated into {\bf{CI/CD pipelines}} using Newman.} \tn % Row Count 21 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Commonly used HTTP Methods}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{The commonly used HTTP methods are GET, POST, PUT, and DELETE. \newline % Row Count 2 (+ 2) {\bf{GET}} is used to retrieve data from a server. \newline % Row Count 3 (+ 1) {\bf{POST}} is used to create or add new data to the server. \newline % Row Count 5 (+ 2) {\bf{PUT}} is used to update or replace an existing resource on the server. \newline % Row Count 7 (+ 2) {\bf{DELETE}} is used to remove data or resources from the server. \newline % Row Count 9 (+ 2) Each method performs a different operation depending on the business requirement.% Row Count 11 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{REST \& SOAP}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{REST (Representational State Transfer)}} and {\bf{SOAP (Simple Object Access Protocol)}} are both used for communication between {\bf{Applications}}, but they work differently.\{\{nl\}\}} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{REST}} is an {\bf{Architectural Style}}, whereas {\bf{SOAP}} is a {\bf{Protocol}}.\{\{nl\}\}} \tn % Row Count 6 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{My unnderstaning is that\{\{nl\}\} {\bf{REST APIs}} commonly exchange data in {\bf{JSON}} format over {\bf{HTTP}} or {\bf{HTTPS}}.\{\{nl\}\} {\bf{SOAP APIs}} use {\bf{XML}} messages and follow strict rules for {\bf{Security}} and {\bf{Messaging}}.\{\{nl\}\}} \tn % Row Count 11 (+ 5) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{REST APIs}} are commonly tested using {\bf{Postman}}, {\bf{Swagger}}, and {\bf{Insomnia}}, while {\bf{SOAP APIs}} are commonly tested using {\bf{SoapUI}} and {\bf{Postman}}.} \tn % Row Count 15 (+ 4) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{REST}} is commonly used for {\bf{Web Applications}}, {\bf{Mobile Applications}}, and {\bf{Microservices}} because it is simple and fast.\{\{nl\}\} {\bf{SOAP}} is commonly used in {\bf{Enterprise Applications}}, such as {\bf{Banking}} and {\bf{Healthcare}}, where {\bf{Security}} and {\bf{Reliability}} are important.} \tn % Row Count 21 (+ 6) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Environment}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Environment:}} A set of {\bf{key-value variables}} specific to an environment, such as {\bf{Development}}, {\bf{QA}}, {\bf{Staging}}, or {\bf{Production}}. \newline % Row Count 3 (+ 3) • Lets you switch between {\bf{environments}} without manually changing the {\bf{request URLs}}. \newline % Row Count 5 (+ 2) • Stores reusable values such as {\bf{base URL}}, {\bf{authentication token}}, and {\bf{user credentials}}. \newline % Row Count 8 (+ 3) {\bf{Example:}} \newline % Row Count 9 (+ 1) {\bf{base\_url}} = https://dev.api.com ({\bf{Development}}) \newline % Row Count 11 (+ 2) {\bf{base\_url}} = https://prod.api.com ({\bf{Production}})% Row Count 13 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Collection}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Collections}} allow multiple {\bf{API requests}} to be organised into a single {\bf{reusable}} group.\{\{nl\}\} e.g., all requests for the {\bf{Worker Screening API}}} \tn % Row Count 4 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{How to perform API Testing}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{In {\bf{API testing}}, we send a {\bf{request}} to the {\bf{API}} using known {\bf{input data}} and then analyse the {\bf{response}} returned by the {\bf{server}}.} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{○ My role during {\bf{API testing}} is to verify that the {\bf{API}} behaves correctly and returns the {\bf{expected results}}.} \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{○ To address this, I verify the accuracy of the {\emph{ {\bf{response data}}, }} {\bf{HTTP status code}}, {\emph{ {\bf{response time}}, }} {\bf{error codes}} returned by the {\bf{API}}, {\emph{ {\bf{authentication}} and {\bf{authorization}} behaviour, }} {\bf{non-functional aspects}} such as * {\bf{performance}} and {\bf{security}}.} \tn % Row Count 12 (+ 6) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{○ Once I send a {\bf{request}} to an {\bf{endpoint}} in {\bf{Postman}} and click the {\bf{Send}} button, I receive the {\bf{response}} in the {\bf{response body}} together with the {\bf{HTTP status code}}.} \tn % Row Count 16 (+ 4) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{○ There are several ways to verify that the returned data is correct. \{\{nl\}\}-{}-The simplest method is checking whether the {\bf{API}} returns the {\bf{expected status code}}. \{\{nl\}\}-{}-Another method is writing {\bf{assertions}}. \{\{nl\}\}-{}-I commonly create {\bf{assertions}} to validate the {\bf{response time}}, {\bf{status code}}, {\bf{status code description}}, {\bf{response type}}, {\bf{response headers}}, and specific {\bf{values}} or {\bf{strings}} within the {\bf{response body}}.} \tn % Row Count 26 (+ 10) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{○ {\bf{Postman}} also provides many {\bf{built-in snippets}} using the {\bf{Chai JavaScript library}}. These snippets allow me to quickly validate {\bf{status codes}}, verify that the {\bf{response}} contains {\bf{expected text}}, or compare the {\bf{response body}} against {\bf{expected values}}.} \tn % Row Count 32 (+ 6) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.09034 cm} x{2.88666 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{HTTP Response Status Codes}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{200 OK}} & {\bf{Request}} successful. \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{201 Created}} & {\bf{Resource}} created successfully. \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{400 Bad Request}} & Invalid {\bf{request}} or {\bf{input data}}. \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} {\bf{401 Unauthorized}} & Missing, invalid, or expired {\bf{authentication token}}. \tn % Row Count 8 (+ 3) % Row 4 \SetRowColor{LightBackground} {\bf{403 Forbidden}} & {\bf{Authenticated}} but {\bf{permission denied}}. \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} {\bf{404 Not Found}} & {\bf{Resource}} or {\bf{endpoint}} not found. \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{500 Internal Server Error}} & Unexpected {\bf{server}} error. \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} {\bf{503 Service Unavailable}} & {\bf{Server}} temporarily unavailable. \tn % Row Count 16 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Positive and Negative API testing}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Positive Testing}} verifies that an {\bf{API}} behaves correctly when {\bf{valid data}} is provided.\{\{nl\}\} {\bf{Negative Testing}} verifies that the {\bf{API}} handles {\bf{invalid requests}} correctly without crashing or exposing {\bf{unexpected behaviour}}.} \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{My role while performing {\bf{API Testing}} is to ensure both {\bf{Positive}} and {\bf{Negative Scenarios}} are fully covered.\{\{nl\}\} To address this, I execute requests using {\bf{valid input}} to confirm successful processing and expected responses. I also test {\bf{missing mandatory fields}}, {\bf{invalid data types}}, {\bf{incorrect parameters}}, {\bf{expired authentication tokens}}, {\bf{unsupported HTTP methods}}, and {\bf{malformed payloads}}.\{\{nl\}\} For every scenario, I validate the returned {\bf{HTTP Status Code}}, {\bf{Response Body}}, and {\bf{Error Messages}}.\{\{nl\}\} As a result, {\bf{Positive}} and {\bf{Negative Testing}} help ensure the {\bf{API}} is both {\bf{functional}} and {\bf{resilient}}.} \tn % Row Count 19 (+ 14) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Can a POST request create a resource?}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Yes.}}\{\{nl\}\} {\bf{POST}} is primarily used to {\bf{create new resources}} on the {\bf{Server}}.\{\{nl\}\} My role while testing {\bf{POST APIs}} is to verify that the {\bf{resource}} is successfully created and that the {\bf{API}} returns the correct {\bf{Response}}.\{\{nl\}\} To address this, I validate the {\bf{Request Payload}}, execute the {\bf{API}}, verify the {\bf{HTTP Status Code}}, confirm the {\bf{Response Body}}, and check that the newly created {\bf{data}} exists within the {\bf{Application}} or {\bf{Database}}, where applicable.\{\{nl\}\} As a result, I can confirm that the {\bf{API}} successfully creates new {\bf{resources}} and behaves according to the {\bf{Business Requirements}}.} \tn % Row Count 13 (+ 13) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Path paramerter \& Query Parameter}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Path Parameter:}} A value included in the {\bf{API URL path}} to identify a {\bf{specific resource}}. \newline % Row Count 2 (+ 2) {\bf{Example:}} /users/123 \newline % Row Count 3 (+ 1) {\bf{Query Parameter:}} A value added after the {\bf{?}} in the {\bf{URL}} to {\bf{filter}}, {\bf{search}}, {\bf{sort}}, or {\bf{control the response}}. \newline % Row Count 6 (+ 3) {\bf{Example:}} /users?status=active% Row Count 7 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Payload}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{A {\bf{Payload}} is the actual {\bf{data}} sent from the {\bf{Client}} to the {\bf{Server}} as part of an {\bf{API Request}}.\{\{nl\}\} My role while testing {\bf{APIs}} is to ensure that the {\bf{Payload}} contains the correct information before sending the request.\{\{nl\}\} To address this, I validate the {\bf{Payload Structure}}, {\bf{Field Names}}, {\bf{Mandatory Fields}}, {\bf{Data Types}}, and {\bf{Business Values}} before executing the request.\{\{nl\}\} I also verify that the {\bf{API}} processes the {\bf{Payload}} correctly and returns the expected {\bf{Response}}.\{\{nl\}\} As a result, I can confirm that the {\bf{API}} correctly accepts, validates, and processes the incoming {\bf{data}}.} \tn % Row Count 13 (+ 13) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Components of HTTP request}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{An {\bf{HTTP Request}} consists of several important components.} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{1. {\bf{HTTP Request Method}}, such as {\bf{GET}}, {\bf{POST}}, {\bf{PUT}}, {\bf{PATCH}}, or {\bf{DELETE}}, which defines the action to be performed.} \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{2. {\bf{Uniform Resource Identifier (URI)}}, which represents the {\bf{endpoint}} where the API is hosted.} \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{3. {\bf{Resources}} and {\bf{Parameters}}, including {\bf{Path Parameters}} and {\bf{Query Parameters}}, which are used to pass information to the API.} \tn % Row Count 10 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{4. {\bf{Request Header}}, which carries {\bf{metadata}} as {\bf{key-value pairs}}, such as {\bf{Content-Type}}, {\bf{Authorization}} tokens, {\bf{Accept}}, and other request information.} \tn % Row Count 14 (+ 4) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{5. {\bf{Request Body}}, also known as the {\bf{Payload}}, which contains the data being sent to the server. It is commonly used with {\bf{POST}}, {\bf{PUT}}, and {\bf{PATCH}} requests.} \tn % Row Count 18 (+ 4) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{-{}-Together, these components make up a complete {\bf{HTTP Request}}.} \tn % Row Count 20 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Challenges in API Testing?}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Some of the common challenges involved in API testing include {\bf{API documentation, database access, and authorization}}. \newline % Row Count 3 (+ 3) -{}-{\bf{API documentation}} is important because incomplete or outdated documentation can make it -{}-difficult to understand the API behaviour and expected responses. \newline % Row Count 7 (+ 4) -{}-{\bf{Obtaining access to the database}} when backend data validation is required. \newline % Row Count 9 (+ 2) -{}-{\bf{Authorization}} can also be challenging because APIs often require authentication tokens, credentials, or different user roles before requests can be executed successfully.% Row Count 13 (+ 4) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Authentication and Authorization}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Authentication}} and {\bf{Authorization}} are both used to secure {\bf{APIs}}, but they serve different purposes. \{\{nl\}\}Authentication = Who are you? (Identity Verification) \{\{nl\}\}Authorization = What can you access? (Permission Verification)} \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Authentication}} verifies the {\bf{identity}} of the user or application. It answers the question, {\bf{"Who are you?"\{\{nl\}\}}} Common authentication methods include {\bf{Bearer Tokens}}, {\bf{OAuth}}, {\bf{Basic Authentication}}, and {\bf{API Keys}}.} \tn % Row Count 10 (+ 5) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Authorization}} determines what an {\bf{authenticated user}} is allowed to access or perform. It answers the question, {\bf{"What are you allowed to do?"\{\{nl\}\}}} It checks the user's {\bf{roles}}, {\bf{permissions}}, or {\bf{access rights}} before allowing access to a {\bf{resource}}.} \tn % Row Count 16 (+ 6) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Example: \{\{nl\}\}401 Unauthorized → Authentication failed (invalid or missing token). \{\{nl\}\}403 Forbidden → Authentication succeeded, but the user doesn't have permission.} \tn % Row Count 20 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Authentication technique}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Some of the commonly used {\bf{Authentication}} techniques include \{\{nl\}\}○{\bf{Session or Cookie-Based Authentication}}, \{\{nl\}\}○{\bf{Basic Authentication}},\{\{nl\}\}○{\bf{Digest Authentication}}, and \{\{nl\}\}○{\bf{OAuth}}.} \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{○{\bf{Session or Cookie-Based Authentication}} is commonly used in traditional {\bf{Web Applications}}.} \tn % Row Count 7 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{○{\bf{Basic Authentication}} uses a {\bf{Username}} and {\bf{Password}} encoded within the {\bf{Request}}.} \tn % Row Count 9 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{○{\bf{Digest Authentication}} is similar to {\bf{Basic Authentication}} but provides additional {\bf{Security}} by encrypting the {\bf{Credentials}}.} \tn % Row Count 12 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{○{\bf{OAuth}} is widely used for modern {\bf{Web Applications}} because it provides secure {\bf{Token-Based Authentication}} without exposing {\bf{User Credentials}}.} \tn % Row Count 16 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Variables}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Variables}} are used to store {\bf{reusable values}} that can be referenced throughout a {\bf{Postman Collection}}. \{\{nl\}\}• Defined using {\bf{double curly braces}}: {\bf{\{\{variable\_name\}\}}} \{\{nl\}\}• Can be used in {\bf{URLs}}, {\bf{Headers}}, {\bf{Request Body}}, and {\bf{Scripts}}.\{\{nl\}\}\{\{nl\}\}-{}-Variables allow values to be stored and reused throughout {\bf{API requests}}.\{\{nl\}\} -{}-My role while using {\bf{variables}} is to eliminate {\bf{hardcoded values}} and improve {\bf{maintainability}}.\{\{nl\}\} -{}-To address this, I use {\bf{Global Variables}}, {\bf{Collection Variables}}, {\bf{Environment Variables}}, {\bf{Local Variables}}, and {\bf{Data Variables}} depending on the testing scenario.\{\{nl\}\} -{}-For example, instead of hardcoding the {\bf{Base URL}} in every request, I store it as an {\bf{Environment Variable}}. If the environment changes from {\bf{Development}} to {\bf{UAT}}, I simply switch the {\bf{Environment}} without modifying each request individually.\{\{nl\}\} -{}-As a result, {\bf{variables}} make {\bf{API requests}} easier to maintain, more {\bf{reusable}}, and less prone to {\bf{manual errors}}.} \tn % Row Count 21 (+ 21) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Different types of Variables}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Global Variables}} are accessible across {\bf{every Collection}} and {\bf{Environment}} within the {\bf{workspace}}.} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Environment Variables}} are available only within the currently selected {\bf{Environment}}, such as {\bf{Development}}, {\bf{QA}}, or {\bf{UAT}}.} \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Collection Variables}} are available only within a specific {\bf{Collection}}, regardless of which {\bf{Environment}} is selected.} \tn % Row Count 9 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Postman}} follows a {\bf{Variable Precedence}} order when resolving variables. The priority from highest to lowest is {\bf{Local Variables}} → {\bf{Data Variables}} → {\bf{Environment Variables}} → {\bf{Collection Variables}} → {\bf{Global Variables}}.} \tn % Row Count 14 (+ 5) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{As a result, understanding {\bf{Variable Scope}} helps prevent {\bf{conflicts}}, improves {\bf{maintainability}}, and keeps {\bf{API requests}} organised and {\bf{reusable}}.} \tn % Row Count 18 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Pre-request Script}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Pre-request Script}}: A JavaScript script that runs before an API request is sent. \newline % Row Count 2 (+ 2) They are written in the Pre-request Script tab. \newline % Row Count 3 (+ 1) Commonly used for: \newline % Row Count 4 (+ 1) ○ {\bf{Setting dynamic variables}}, such as timestamps or generated tokens. \newline % Row Count 6 (+ 2) ○ Generating {\bf{authentication tokens}} before calling an API endpoint. \newline % Row Count 8 (+ 2) ○ {\bf{Chaining data}} from a previous request. \newline % Row Count 9 (+ 1) ○ {\bf{Preparing request data}} before execution. \newline % Row Count 10 (+ 1) Example: \seqsplit{pm.environment.set("timestamp"}, Date.now());% Row Count 12 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}