0% found this document useful (0 votes)
41 views5 pages

Postman Notes - (PAN India)

The document provides steps to access GitHub REST API endpoints, generate a personal access token, create a Postman workspace to make API requests, add environment variables and response validation snippets, and run the API collection via the Postman UI or Newman CLI with reporting. Key steps include searching the GitHub docs for REST API documentation, generating a personal access token, creating a Postman collection and setting the authentication token, adding an environment with base URL and token variables, and running the collection to test the API requests.

Uploaded by

Adarsh Vk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views5 pages

Postman Notes - (PAN India)

The document provides steps to access GitHub REST API endpoints, generate a personal access token, create a Postman workspace to make API requests, add environment variables and response validation snippets, and run the API collection via the Postman UI or Newman CLI with reporting. Key steps include searching the GitHub docs for REST API documentation, generating a personal access token, creating a Postman collection and setting the authentication token, adding an environment with base URL and token variables, and running the collection to test the API requests.

Uploaded by

Adarsh Vk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

How to Get the End Points:

1. Go to Git hub application.


2. Scroll down to the footer and look for Docs link.
3. Right click on Docs link & open it in new tab.
4. Once you open the document search for Rest API.
5. Go to Overview Hamburger & Search for Repositories & click on
it.
6. In the dropdown again search for Repositories & click on it.

Request Descriptions:
 Go to Overview Hamburger and search for Create a repository
for the authenticated user and click on it.
Here you will get End points & method name.
 Go to Overview Hamburger and search for Get a repository
 Go to Overview Hamburger and search for Update a repository
 Go to Overview Hamburger and search for Delete a repository

Base URL: GitHub Application


https://api.github.com

Note:
Don’t give space between Repository Name at the time of Creation.
Avoid giving unnecessary space.
Steps to Generate Token:

 Go to https://github.com/
 Click on Profile icon & click on Settings.
 Click on Developer Settings.
 Click on Personal Access Token & Select Token (Classic).
 Click on Generate New Token & Select Generate New
Token (Classic).
 Click on Generate New Token & Select Generate New
Token (Classic).
 Fill the required details.
 Copy the Token ID & Paste it in Notepad.
 Go to Postman. ( https://www.postman.com/ )
 Create Workspace.
 Create new Collection under Workspace.
 Add Request in collection & Edit method name.
 Select Method & Enter Base URL along with end points.
 Click on Body & Select Raw & JSON.
 Add Body.
 Go to Authorization.
 Select Bearer Token from dropdown.
 Give the Token ID.
 Save the request & Click on Send Button.
Steps to Create Environment:
1. Click on Environment.
2. Click on Create New Environment.
3. Edit Environment Name.
4. Add Variables under environment.
5. Give Variable Name & Initial Value.
Create variable for BaseURL, Token, OwnerName

Steps to Add Snippets:


1. Click on Tests.
2. Add Snippets.
3. To validate Status code- Status code: Code is 200
4. To validate Status string- Status code: Code name has string
5. To validate Response time- Response time is less than 200ms
6. To validate JSON Value- Response body: JSON value check
JSON Value Check for Repo Name
JSON Value Check for Repo Description
JSON Value Check for Repo Description
JSON Value Check for OwnerName

Steps to Run Collection:


1. Go to particular Collection.
2. Click on View More Actions.
3. Click on Run Collection.
4. Give the necessary inputs.
Iteration Count & Delay
5. Click on Run.
Steps to Run Collection Using Newman Command
Prompt:
1. Download & Install NodeJS
2. Open Command Prompt
3. node -v --> Version of Node
4. npm -v --> Version of npm
5. npm install -g newman --> install Newman
6. npm install -g newman-reporter-html --> install report
generator
7. Go to postman and Export the collection & environment.
8. newman run **give collection path** -e **environment path**
--> To run (Drag and drop the path)
9. newman run **give collection path** -e **environment path**
-r html --> To generate the report

Node JS:
 It is a platform build on Chrome's JavaScript runtime for easily
building
 Fast & Scalable network Application.

npm:
 Node Package Manager is a library and registry for JavaScript
Software Package.

Newman:
 It is a command li ne Runner for Postman.

You might also like