Postman Topics Documentation

POSTMAN

Test and debug RESTful APIs efficiently using Postman’s powerful
features like collections and environments.

Postman – API Testing and Collaboration Tool

1. What is Postman?

Postman is a collaboration platform for API development and testing. It allows users to send HTTP requests, inspect responses, automate workflows, and document APIs.

2. Installing Postman
3. Creating Your First Request
  • Open Postman → Click + New Tab
  • Choose method: GET, POST, PUT, DELETE, etc.
  • Enter the API endpoint (e.g., https://api.example.com/users)
  • Click Send to execute the request and view the response
4. HTTP Methods Supported

Postman supports all common HTTP methods:

  • GET: Retrieve data
  • POST: Send data to create new records
  • PUT: Update existing data
  • DELETE: Remove data
  • PATCH: Partially update data
5. Headers and Parameters

Customize requests with headers and parameters:

  • Headers: Add metadata (e.g., Content-Type: application/json)
  • Query Params: Add filters or dynamic data (e.g., ?userId=1)
6. Body (for POST/PUT)

Used to send data in POST, PUT, or PATCH requests.

{
"name": "John",
"email": "john@example.com"
}

Select Body → raw → JSON for JSON input.

7. Viewing the Response
  • Postman displays response body, status code, time, and size
  • Click Body, Headers, or Cookies to inspect details
  • Supports viewing as JSON, HTML, text, etc.
8. Saving Requests to Collections

Collections group related requests together.

  • Click Save → Choose a collection or create a new one
  • Organize your API testing flows (e.g., User APIs, Product APIs)
9. Authentication Methods

Postman supports various authentication schemes:

  • Bearer Token: Add under Authorization → Bearer Token
  • Basic Auth: Use username/password
  • OAuth 2.0, API Key, and others are also supported
10. Importing API Collections

Import APIs from files, links, or OpenAPI/Swagger definitions:

  • Click Import → Choose file or URL
  • Supports formats like .postman_collection.json, .yaml, .har, etc.

Postman Environments, Scripting, and Automation

11. Environment and Global Variables

Variables help reuse values across requests and environments (e.g., API URLs, tokens).

  • Click the Environment dropdownManage Environments
  • Set key-value pairs (e.g., base_url = https://api.example.com)
  • Use in requests: {{base_url}}/users
12. Pre-request Script

Runs JavaScript code before a request is sent (e.g., generate tokens, time-stamps).

// Example: Add timestamp header
pm.environment.set("timestamp", Date.now());
13. Tests (Post-request Scripts)

Run JavaScript after request is sent to validate the response.

pm.test("Status code is 200", function () {
  pm.response.to.have.status(200);
});
14. Using Console

Postman Console helps debug pre-request and test scripts.

  • Open via View → Show Postman Console or Ctrl + Alt + C
  • Use console.log() in scripts to output values
15. Running Collections with Collection Runner

Execute a full collection of requests for automated testing.

  • Click Runner → Choose collection → Click Run
  • Run with data (CSV/JSON) for testing multiple inputs
16. Data-Driven Testing

Run the same request multiple times with data from a file.

  • Runner → Select data file (CSV or JSON)
  • Use {{variable}} inside requests to access values from file
17. Mock Servers

Simulate API endpoints when backend isn’t ready.

  • Create → Mock Server → Define expected responses
  • Use mock URLs in frontend development or testing
18. Monitor APIs

Postman Monitors automatically run requests at scheduled intervals.

  • Click Monitor on a collection
  • Set frequency, regions, and email alerts for failures
19. Sharing Collections

Collaborate with your team by sharing collections.

  • Click Share → Choose link or workspace
  • You can also export as JSON and import in another system
20. Using Postman with Git

Postman supports version control via Git using the Postman API or exporting collections.

  • Export collections as JSON
  • Use Git to track changes to API workflows in a repository

Postman Collaboration and Advanced Features

21. Workspaces

Workspaces let teams collaborate on shared APIs, collections, and environments.

  • Types: Personal, Team, Public
  • Create via Workspace → Create Workspace
  • Invite collaborators by email
22. Postman Visualizer

Use HTML + JavaScript to render API response data visually inside Postman.

const template = ` {{#each response}} {{/each}}
Name Email
{{name}} {{email}}
`;
pm.visualizer.set(template, { response: pm.response.json() });
23. APIs Tab (API Lifecycle Management)

Manage your API’s full lifecycle inside Postman using OpenAPI/Swagger schema.

  • Click on APIs tab → Create new API definition
  • Add documentation, test cases, monitors, versioning
24. Postman CLI (Newman)

Newman is Postman’s command-line runner for automating collection runs.

  • Install via NPM: npm install -g newman
  • Run: newman run collection.json
  • Use in CI/CD pipelines like GitHub Actions, Jenkins, etc.
25. Postman Echo

Public API endpoints for learning and testing Postman features.

  • Example: https://postman-echo.com/get
  • Try out headers, params, body, and scripts using this API
26. Code Snippets (Request Generators)

Generate sample code for sending requests in different languages.

  • Click Code (top-right of request tab)
  • Choose language: cURL, Python, Java, Node.js, Go, etc.
  • Copy and paste code into your app or terminal
27. History Tab

Keeps track of every request sent (including temporary unsaved ones).

  • Located on the left sidebar
  • Right-click → Save to Collection or re-run
28. Postman Cloud Sync

All saved requests, environments, and collections are backed up to the cloud if signed in.

  • Enables access across multiple devices
  • Auto-sync ensures your changes are never lost
29. Roles and Permissions

In Team workspaces, manage access to collections and environments.

  • Roles: Viewer, Editor, Admin
  • Configure access under workspace settings
30. Integrations

Postman can be integrated with tools like Slack, GitHub, Jenkins, and more.

  • Click your avatar → Integrations
  • Connect to external services to automate flows or receive alerts

Postman Reference Links

1. Official Postman Website

Main site for downloads, features, and product updates.

https://www.postman.com/

2. Postman Learning Center

Comprehensive documentation and learning guides for beginners to advanced users.

https://learning.postman.com/

3. Postman API Reference

Details on how to programmatically use Postman’s own API (manage workspaces, collections, etc.).

Postman Public Workspace

4. Postman YouTube Channel

Watch webinars, tutorials, and feature releases.

https://www.youtube.com/c/Postman

5. Newman (CLI) Documentation

Guide to running Postman collections from the command line using Newman.

https://www.npmjs.com/package/newman

6. Postman Blog

Read about use cases, tutorials, and industry trends.

https://blog.postman.com/

7. Postman Public API Collections

Explore and fork thousands of collections shared by the community and companies.

https://www.postman.com/explore

8. Postman GitHub Repository

Source code for open-source Postman tools like Newman.

https://github.com/postmanlabs