Postman quick start

View as Markdown

Postman’s API client enables you to create and send API requests, including HTTP, GraphQL, and gRPC requests. You can send a request to an endpoint, retrieve data from a data source, and test an API’s functionality.

In this quick start, you will send your first API request using the Postman Echo API and see the response returned directly in Postman. You’ll also learn how to save your request to a collection and write a basic test to validate the API response.

Send an API request

Make sure you’ve downloaded and installed the Postman desktop app. When you’re ready, open the Postman desktop app and send your first API request.

  1. Click Add icon Add in the workbench to open a new tab.
  2. Enter “postman-echo.com/get” for the request URL.
  3. Click Send.

Postman displays the response data sent from the server in the lower pane.

Sending a request

How it works

In this example, Postman acts as the client application and communicates with an API server. Here’s what happened when you clicked Send:

  1. Postman sent a GET request to the Postman Echo API server located at postman-echo.com.
  2. The API server received the request, processed it, and returned a response to Postman.
  3. Postman received the response and displayed it in the Response pane.

Create a collection and save your request

You can save a request by creating a new collection. A collection is a group of saved requests that you can organize into folders. You can also save responses, documentation, and tests in a collection. Collections help you stay organized and share your work with teammates.

To create a collection and save a request in the new collection, do the following:

  1. If you haven’t already, install the Postman desktop app and sign in to Postman.

  2. In the request builder, click Save.

  3. Click New Collection. Name the collection.

    Save request to collection
  4. Click Save to add the request to the collection.

After you save the request, your new collection and the request are listed under Collections in the sidebar.

To learn more about collections, visit the Collections overview.

Write a test for your API request

API tests are a way to ensure that your API is behaving as you expect it to. For example, you might write a test to validate your API’s error handling by sending a request with incomplete data or wrong parameters. You can write tests for your Postman API requests in JavaScript and add them to individual requests, collections, and folders in a collection. Postman includes code snippets you can add and then change to suit your test logic.

To write a test, do the following:

  1. In your request, click the Scripts tab, then click Post-response.

  2. Click Code icon Snippets at the lower right of the code editor, then select Status code: Code is 200. This will enter the following test code:

    1pm.test("Status code is 200", function () {
    2 pm.response.to.have.status(200);
    3});
  3. Click Send.

After the request runs, the test will run. In the response section, click Test Results to review the results of your test.

To learn more about writing tests, go to Write scripts to test API response data in Postman.