- Installation and updates
- Sending your first request
- Navigating Postman
- New button
- Creating the first collection
- Postman account
- Keyboard Shortcuts
- Troubleshooting In-app Issues
- Authorizing requests
- Working with Tabs
- Visualize API responses
- Validating Requests Against Schema
- Generate code snippets
- Using GraphQL
- Making SOAP requests
- Capturing HTTP requests
- Debugging and logs
- Troubleshooting API requests
- Intro to collections
- Creating collections
- Sharing collections
- Commenting on collections
- Managing collections
- Version Control for Collections
- Using Markdown for descriptions
- Data formats
- Working with OpenAPI
- Collaborating in Postman
- Roles and permissions
- Managing your team
- Requesting access
- Team Settings
- Audit logs
- Intro to scripts
- Pre-request scripts
- Test scripts
- Test examples
- Branching and looping
- Postman Sandbox API reference
- Intro to collection runs
- Starting a collection run
- Using environments in collection runs
- Building workflows
- Running multiple iterations
- Sharing collection runs
- Working with data files
- Debugging a collection run
- Command line integration with Newman
- Integration with Jenkins
- Integration with Travis CI
- Newman with Docker
- Documenting your API
- Authoring your documentation
- Publishing your docs
- Viewing documentation
- Custom documentation domains
- Intro to mock servers
- Setting up a mock server
- Mocking with examples
- Mocking with the Postman API
- Matching algorithm
- Intro to Monitoring
- Setting up a monitor
- Viewing monitor results
- Monitoring APIs and websites
- Set up integrations to receive alerts
- Running Postman monitors using static IPs
- Troubleshooting monitors
- FAQs for monitors
- Intro to Workspaces
- Creating Workspaces
- Using Workspaces
- Managing Workspaces
- Viewing changelogs and restoring collections
- The API Workflow
- Managing and Sharing APIs
- Versioning APIs
- Viewing and analyzing APIs
- Validating Elements Against Schema
- Customizing Postman
- Find and Replace
- Purchasing Postman
- 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
- Intro to Integrations
- Custom Webhooks
- Microsoft Flow
- Microsoft Teams
- Publishing 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 users wanted to edit responses before saving them, and add new responses. Examples provides 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.