0
0
Postmantesting~5 mins

First API request in Postman

Choose your learning style9 modes available
Introduction

Making your first API request helps you check if a service works and understand how to get data from it.

You want to see if a website or app backend is working.
You need to get information like weather or user details from a server.
You want to test if your API key or login works.
You are learning how APIs send and receive data.
You want to check the response time of a service.
Syntax
Postman
GET https://api.example.com/data
Headers:
  Authorization: Bearer <your_token>
  Content-Type: application/json

Use GET to ask for data without changing anything.

Headers send extra info like your login or data type.

Examples
This gets the post with ID 1 from a test API.
Postman
GET https://jsonplaceholder.typicode.com/posts/1
This sends login info to get access.
Postman
POST https://api.example.com/login
Body (JSON):
{
  "username": "user1",
  "password": "pass123"
}
Sample Program

This is a simple GET request to a public API that returns a post's details. You can see the title and body in the response.

Postman
GET https://jsonplaceholder.typicode.com/posts/1

// Expected response:
// {
//   "userId": 1,
//   "id": 1,
//   "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
//   "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
// }
OutputSuccess
Important Notes

Always check the API documentation for the correct URL and method.

Use Postman's interface to set headers and body easily.

Look at the status code: 200 means success, 404 means not found.

Summary

First API request helps you connect to and get data from a service.

Use GET method to retrieve data without changing it.

Check response and status code to confirm success.