- Installation and updates
- Sending the first request
- Creating the first collection
- Navigating Postman
- Keyboard Shortcuts
- Postman account
- New button
- Troubleshooting In-app Issues
- Customizing Postman
- Find and Replace
- Troubleshooting API requests
- Debugging and logs
- Capturing HTTP requests
- Interceptor extension
- Generate code snippets
- Making SOAP requests
- Working with Tabs
- Using GraphQL
- Visualize API responses
- Intro to collections
- Creating collections
- Sharing collections
- Managing collections
- Using Markdown for descriptions
- Data formats
- Working with OpenAPI
- Commenting on collections
- Version Control for Collections
- Intro to scripts
- Pre-request scripts
- Test scripts
- Test examples
- Branching and looping
- Postman Sandbox
- Postman Sandbox API reference
- Intro to environments and globals
- Manage environments
- Manage globals
- Variables complete reference
- Dynamic Variables List
- Intro to collection runs
- Starting a collection run
- Using environments in collection runs
- Working with data files
- Running multiple iterations
- Building workflows
- Sharing a collection run
- Debugging a collection run
- Command line integration with Newman
- Integration with Jenkins
- Integration with Travis CI
- Newman with Docker
- Intro to API documentation
- Viewing documentation
- Local environments and shared environments
- How to document using Markdown
- Publishing public docs
- Adding and verifying custom domains
- Adding team name and logo
- Intro to Monitoring
- Setting up a monitor
- Viewing monitor results
- Monitoring APIs and websites
- Set up integrations to receive alerts
- Pricing for monitors
- Troubleshooting monitors
- FAQs for monitors
- Intro to mock servers
- Setting up a mock server
- Mocking with examples
- Mocking with the Postman API
- Matching algorithm
- Introduction to APIs
- Managing APIs
- Sharing APIs and managing roles
- The API Workflow
- Versioning APIs
- Reporting FAQs
- Viewing and analyzing APIs
- Intro to Workspaces
- Creating Workspaces
- Managing Workspaces
- Using Workspaces
- Sharing collections in Workspaces for version 5
- Activity feed and restoring collections
- What is Postman Pro
- Purchasing Postman Pro
- Billing and pricing
- Upgrading to Postman Pro from a trial team
- Team Settings
- Changing your plan
- Managing your team
- Migrating to Postman v7
- Roles and permissions
- Managing your billing
- Intro to Enterprise
- Purchasing Postman Enterprise
- Running Postman monitors using static IPs
- Intro to SSO
- Configuring SSO for a team
- Logging in to an SSO team
- Configuring Microsoft AD FS with Postman SSO
- Setting a custom SAML in Azure AD
- Setting up custom SAML in Duo
- Setting up custom SAML in GSuite
- Setting up custom SAML in Okta
- Setting up custom SAML in Onelogin
- Setting up custom SAML in Ping Identity
- Audit logs
- Public API documentation
This topic covers:
- What is an example?
- Why use examples?
- Adding an example
- Accessing your saved examples
- What happened to the ‘Save Response’ feature?
- How your examples appear in Postman documentation
An example is a tightly coupled request and response pair.
For instance, as shown in the image below, '200 OK custom response' is the name of an example. To complete the example, you can mock an 'example request' and an 'example response'.
Developers can mock a request and response in Postman before sending the actual request or setting up a single endpoint to return the response.
To establish an example during the earliest phase of API development:
- Requires clear communication between team members.
- Aligns their expectations.
- Helps developers and testers start more quickly.
Often it's useful to mock and save a couple of example responses with a request, such as a status code, to make your API more understandable.
Let's say you want to build an API with an endpoint that does not yet exist, or your server isn’t ready. You can mock raw responses and save them. Then, you'll be able to generate a mock endpoint for each of them using Postman's mock service.
Developers can make requests to the mock endpoint and start front-end development or write tests based on the mock response returned from the mock endpoint.
Suppose you are working on a request that is saved in a collection. You can add examples to this request with a new custom response or the response from the server.
You can create examples that define how the response should look. The image below outlines the steps for creating an example with a new response. Note that the base request is loaded as an 'example request' in the Example editor.
After you receive a response from a server, you might want to save the current request and response pair as an example. The steps to save the current request and response pair are similar to creating a new response from scratch. Note that the base request and the response from the server are loaded as the 'example request' and 'example response'.
Later you can return to your base request and resume by clicking on the request name in the upper left corner of the builder.
Click on the Examples dropdown in the upper right corner of the builder to access all your saved examples.
Saving responses has been a Postman feature for a long time. Over time our users wanted to edit responses before saving them, and add new responses. We created Examples to provide that functionality.
You can save responses as before, but now you can edit them whenever you want. To access previously saved responses, click the Examples dropdown.
You can publish Postman API documentation to the web with a single click. Examples display in your API documentation and provide additional details and clarification for your API.
You can edit these examples with real-time updates to the documentation!
This behavior allows teams to mock an example request and response, in addition to simulating the endpoint using mock servers. Front-end and back-end developers and testers can all begin working in parallel, based on the agreed-upon example.