Posts

Adding Access Tokens to Postman Requests: A Step-by-Step Guide

This tutorial aims to generate an access token, add access tokens to a Postman request, and demonstrate how to execute it.

Table of Contents

Request URL

https://restful-booker.herokuapp.com/auth
Sample Request Body
{
	"username": "admin",
	"password": "password123"
}
    

Implementation Steps

Make a collection

Please follow this post to learn how to create a Collection in Postman

Make a request to the Collection

Step 1: To create a new request, click on the 3 dots and select “Add request”.

Step 2: Once you create a new request, then you will get the following window:
Uploading: 183425 of 183425 bytes uploaded.

Provide the requested information.

Step 1: Enter the “name” in the request. Here, the name is “Access Token”.

Step 2: Enter the “URL” in the address bar.

Step 3: Now, select the “POST” request from the list of request methods.

Step 4: Add a Request Body to the Post request Steps: 
Click on the Body

Check the raw option
 

Select the JSON

 Add a Request body

This is done to ensure that we send the request in the correct format that the server expects. The request body example mentioned at the beginning of the tutorial should be copied and pasted into the Postman request body. 

Step 5:: Press the “Send” button.

Ensure that the Response has been validated

Format Type

Each request has a defined response to it as defined by the Content-Type header. That response can be in any format. Such as in the above example, we have a JSON code file.

Below are the various format types present in Postman.

JSON


Congratulations on finishing this tutorial and I hope you found it helpful! Happy learning!

You can now copy this token value and use it for another request.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.