API Testing with Postman for Beginners: A Step-by-Step Guide for Freshers

Short answer: API testing checks that an application’s APIs return the right data, status codes and errors, quickly and securely, without going through the user interface. Postman is the most common tool for learning it. Start by sending GET and POST requests to a practice API, then check status codes and response bodies, write simple test scripts, use variables and environments, group requests into collections, and finally run them automatically from the command line or a CI pipeline.

Most modern applications are built from APIs: the mobile app, the website and partner systems all talk to the same back end. That is why API testing skills appear in so many QA job descriptions, and why testers who can test below the UI find bugs earlier.

What is an API, and what is API testing?

An API (application programming interface) lets one program request data or actions from another. Most web APIs follow REST principles and exchange JSON over HTTP. API testing sends requests to these endpoints and verifies the responses: the status code, the data returned, the headers, the response time and how the API handles bad input and unauthorised access.

Why test APIs and not just the UI?

  • Earlier feedback: APIs are often ready before the UI, so testing can start sooner.
  • Faster and more stable tests: no browsers, pages or locators to break.
  • Better coverage: you can test edge cases and error handling that are hard to reach through the UI.
  • Security checks: authentication, authorisation and input validation live at the API layer.

HTTP basics every API tester needs

Method Used to Example
GET Read data Get a list of users or one user by ID
POST Create data Create a new user
PUT Replace data Update all fields of a user
PATCH Partially update data Change only a user’s email
DELETE Remove data Delete a user
Status code Meaning What to test
200 OK / 201 Created Request succeeded / resource created Correct data returned; new record exists
400 Bad Request Invalid input Missing or wrong fields are rejected with a clear message
401 Unauthorized Not authenticated Requests without a valid token are blocked
403 Forbidden Authenticated but not allowed Users cannot access other users’ data
404 Not Found Resource does not exist Unknown IDs return 404, not a crash
500 Internal Server Error Server-side failure Should not happen for valid or invalid input; report as a bug

Your first API test in Postman, step by step

  1. Install Postman (desktop app) or use the web version, and create a workspace.
  2. Pick a practice API: public test APIs such as JSONPlaceholder, Restful-Booker or ReqRes are built for learning.
  3. Send a GET request to an endpoint that lists items, and read the status code, response time and JSON body.
  4. Send a POST request with a JSON body in the Body tab (raw, JSON) and check you get 201 and the created data back.
  5. Add tests in the request’s test script area using JavaScript and the pm API:
pm.test("Status code is 200", function () {
    pm.response.to.have.status(200);
});

pm.test("Response time is below 1000 ms", function () {
    pm.expect(pm.response.responseTime).to.be.below(1000);
});

pm.test("Returns a list with at least one item", function () {
    const data = pm.response.json();
    pm.expect(data).to.be.an("array").that.is.not.empty;
});

Variables, environments and collections

  • Environments hold values such as baseUrl for dev, test and staging, so the same requests run anywhere: {{baseUrl}}/users.
  • Variables pass data between requests, for example saving an ID from a POST response and using it in the next GET.
  • Collections group related requests into a test suite you can run in order with the Collection Runner, including data-driven runs from a CSV or JSON file.
// Save the new user's id from a POST response for later requests
const body = pm.response.json();
pm.collectionVariables.set("userId", body.id);

Authentication you will meet

Type How it works Testing focus
API key A key sent in a header or query parameter Missing or invalid keys are rejected
Bearer token / JWT A token from a login request sent in the Authorization header Expired, tampered and missing tokens are rejected
OAuth 2.0 Tokens issued by an authorisation server Scopes limit what each token can do
Basic auth Username and password encoded in a header Only over HTTPS; wrong credentials return 401

What to test for each endpoint

  • Correct status code and response structure for valid requests.
  • Field values, data types and required fields in the response.
  • Negative cases: missing fields, wrong types, very long strings, invalid IDs.
  • Authorisation: one user must not read or change another user’s data.
  • Response time under normal conditions.
  • Idempotency: repeating a PUT or DELETE should not cause unexpected side effects.

Automating API tests

Once your collection works, run it automatically. Postman collections can be run from the command line with Newman or the Postman CLI and added to a CI/CD pipeline such as Jenkins or GitHub Actions, so every code change is checked. Many teams also write API tests in code, for example REST Assured with Java or the requests library with pytest in Python. Playwright can test APIs too, which is useful if you already use it for UI tests. See Selenium vs Playwright for how UI automation fits in.

Postman, SoapUI or code?

Tool Best for
Postman Learning, exploring and testing REST APIs quickly; collections and team sharing
SoapUI SOAP web services and enterprise APIs, as well as REST
REST Assured (Java) / pytest + requests (Python) Code-based API tests inside an automation framework

Common API testing interview questions

  • What is the difference between PUT and PATCH?
  • What is the difference between 401 and 403?
  • How do you chain requests in Postman?
  • How would you test an API that requires a token?
  • What is the difference between REST and SOAP?
  • How do you run Postman tests in CI?

Prepare these alongside the rest of our tech interview preparation guide. New to QA? Start with manual vs automation testing for freshers.

Learn API testing at TryCatch Classes

TryCatch Classes’ API Testing Training covers REST, SOAP and GraphQL APIs, test cases and assertions with JSON path and XPath, data-driven frameworks, token-based authentication and OAuth, and integrating API tests into CI/CD, using SoapUI and Postman. For a complete QA path, choose Software Testing Training. Learn at our Borivali West classroom or live online, with a 100% placement guarantee.

A note from Mehul Prajapati, Founder, TryCatch Classes

I have spent 18+ years in IT and training and have personally mentored 12,000+ students. If you are planning your next step in software testing and want a second opinion on your learning path, I am happy to help.

“The technology you learn today may change tomorrow, but your ability to learn will always be your biggest strength. Stay curious, keep upgrading yourself, and never stop growing.”

Message me on WhatsApp at +91 99301 12627 and tell me which blog you read. I would love to hear from you.

Frequently asked questions

Do I need coding for API testing?

You can start with Postman with very little code. Basic JavaScript helps for Postman test scripts, and Java or Python is needed for code-based frameworks like REST Assured or pytest.

Is API testing manual or automation testing?

Both. You can explore and test APIs manually in Postman, then automate the same checks with collections, Newman or code-based frameworks in a CI pipeline.

Which practice APIs are good for beginners?

Free test APIs such as JSONPlaceholder, Restful-Booker and ReqRes are designed for learning and support common request types.

Is API testing a good career skill for freshers?

Yes. API testing appears in many QA and SDET job descriptions because modern applications rely heavily on APIs, and testers who can test below the UI catch bugs earlier.

Cover image: photo by Chris Ried on Unsplash.

Related Training Courses