Postman Beginners Crash Course - Part 1 | Postman Introduction, GUI, Request creation

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome I'm rocof and welcome to postman crash course in this course I am going to go very basic step-by-step and we will learn postman from scratch so do not worry if you have no prior knowledge or experience with postman or API testing I will show you everything from scratch and we will go in a step-by-step way so we will start with the introduction and learn what is postman we will then download and install postman and you can follow this on Windows or Mac operating system and then we will understand the GUI of the tool and we will look at some features I will also show you how you can learn API web services basics just in case you are completely new to API and web services we will then create the first API requests in postman and then we will see how we can create how we can use different HTTP methods like get post put batch delete etc in postman and then we will create our own REST API we will create a local server on our local system and then we will create our REST API and use it for testing on postman so let's get started this is going to be easy and interesting and I will go to my browser on Google I will search for postman and this is the website for postman postman com if you go here you will find some documentation and information about postman and here postman is a complete platform for API development testing and management if you go to the use cases here and see the use case by function it can be used for development testing and management of API is so it is a complete API platform and we are going to focus on the testing part now to get postman you can just click on the download app button here and if you're on Mac it will download as a zip file that you can unzip if you are on Windows let me show you on the windows system I am on my window system and again I will search for postman on Google and I will go to the postman website and here if I click on download the app Here I am getting the option to download and here we can download windows 32-bit or windows 64-bit just to check what is your operating system bit size you can go to my computer or this PC do a right-click and go to properties and here you can check in my case it is 64-bit operating system so I will go and get the 64-bit version so I will download the 64-bit version and this will download as a Exe file that you can double click and then install and start postman so I will go to this file and here it is I will double click and this will start the installation process for postman and this is on windows so you can see it is now installing postman and in case you are on Mac when you download it will be downloaded as a zip file and let me show you so here you can see this will be downloaded as a zip file you can unzip using any unzip utility on your Mac and then you will have the postman app that you can double click and you can start postman on Mac so once it is started the rest of the process is going to be the same so you can see it is now getting started on my windows system and postman is up here and also on my Mac system postman is starting here so here postman is also started let me just close on my Mac system and I will show you on Windows and you can follow the seams on Mac as well so the first thing here I am getting a launch pad where we have option to create a new request to create a collection customize postman using a dark mode or a light mode and some other options in case you do not see the launch pad tab you can close all the tabs open here and then you will find an option to open launch pad and then this is the GUI of postman let us understand the GUI so at the top you can see we have a simple menu where we have option for file here you can create a new element new postman window new Runner window you can go to settings or close and exit then we have edit and here you can do undo redo delete operations then view you can zoom in zoom out or toggle sidebar go to single pane view or two pane view and go to the postman console and then we have developer options here and in the help menu you can check for updates you can go to the documentation or github tutor and go to the support so all these are links if I go to the documentation here you can see it takes me to postman documentation and here we have a very good documentation or very well categorized documentation it can be very helpful and handy let me go back to my postman and now here we have different sections so here the top section this is called header so this area at the top this is the header and I will also mention this here this is our header in postman and then this is the sidebar so this one is the sidebar and here is the Builder area and here we can create our requests and also check the responses so this is the this is the Builder and then at the bottom this is the status bar so this area is called status bar so here these are the four major sections in postman we have the header here then we have the sidebar the Builder and the status bar now if I go and go to the header we have this new button and if I go to new it will open this window where we can create a new request a new collection a new environment etc also we have templates here so these are some popular API is created by postman community and you can see all these templates here these can be very handy and you can look at some examples for example if I want to work with file I will search for file and I'm getting some templates on how to write responses to a file file uploads etc similarly if I search for database I can find some database related post pend api's for example here we have creating database through postman and some other examples then we have API Network now these are some public API is our curated by postman and this again can be very handy for example you want to check some API is related to entertainment and then use them you can see here and similarly there are other categories so this is the new button window also if you go to the new button drop down we have these options to create a new request collection environment etc then we have option to import a collection from all these different sources so you can input a collection from here we have an option of genre and this will open our collection runner window so whenever we run a collection in postman it runs in a collection runner window so you can open a new window from here then we have this option to open a new tab open a new postman window or opener sauna window now if you come here we have an option for workspaces in postman you can create multiple workspaces and then we can also collaborate between teams using the workspaces now here I am NOT getting an option to create a new workspace because I am not signed in so I will have to sign in to create a workspace also you can check a sign in option is here so let me click on sign in and here you can first create a account you can go here and create a account you can use your email or username and password and then create an account you will get our email to verify your account and once you have created an account you can come and sign in so in my case I have a account let me try to sign in and here you can see now I am signed in to postman so now if I click on workspaces I am getting an option to create a new workspace and also if you click on all workspaces it will take you to your browser and it will take you to your account so you can see here you can check your workspaces you can also check a lot of other things on your browser on your account so you can see that themes and a play network templates etc reports here and then you can also go to your account and go to your profile and account settings and notification preferences etc so you can also manage your account from here so if I go back to postman so again they here we have our invite button to invite other users on your workspace so you can use this button to invite your teammates and then here we have an option or button to sync your API requests across devices so if you are logged into postman with your account on multiple devices you can do a sync using this button we also have a button here to capture requests and cookies with postman and if you go here you can set up a proxy and then you can capture the network traffic here we have settings so if I click on settings and go here you can see these are the settings that you can do for postman so in general settings we have a section for requests and you can do the settings from here like if you want to turn on SSL verification or if you want to limit the timeout or response size you can do it from here then here we have the working directory of postman and by default it is this location which is C users and your user postman files just in case you want to change this directory you can do it from here sometimes you may want to change the directory because of space issues or maybe because you do not have complete rights or permissions on C Drive you can always change it from here then we have a section for settings on headers so in case you want to send postman token or you want to follow redirects all the settings you can do I will also show you you can do some of these settings when you are sending a request so I will show that to you later then coming to the user interface here we have settings for the font size and variable open complete open Launchpad and other settings now if I go to themes we have a dark theme for postman and a light theme so you can select a theme from here these are the keyboard shortcuts and these can be very handy when you are working with postman then if I go to data here we have an option to export and import data so you can export all your data and it will be exported as a file and then you can also import all your data using that file from here we have an option for add-ons and we have a new main add-on and Neumann is a dual or a NPM program that can be used for running our postman from command line then we have certificates in case you are using any certificate you can add it here settings for proxy if you are using any proxy you can do the settings here then updates it will show you the latest version available and what is your version so in my case as of now it is the latest version and you can also check for updates you can also automatically download major updates and enable this option here then about postman will show you your version and then some other links for documentation and support and report issue etc so this is about settings and if you go to the settings you will have some more options for documentation release notes and support so you can also go to these links directly from here if you are working in organizations you may want to look at the security feature so that you know that your data is secure and you can see what postman says about security and data security and you can read all the details about security features here then we have an option for notifications any new notifications will be shown here then we have options for to it so you can do it about postman from here then there is an option to man accounts if you click here you can see your account you can sign out go to your profile and account settings from here and then we have an option to upgrade just in case you want to upgrade postman you can upgrade from here so you can see on the free version all these limits we have the API is she request shade history mock usage and you can see how much you have consumed and in case you want to update you can also update your postman now if I come to the sidebar on the sidebar we have history collections and api's so once we create our collections they will be shown here and under our collections we can create our API requests and then in the history you will see all the history of the requests that you have run on postman so you will see history here also in case you do not want to see the sidebar you can click on this option to hide the sidebar and then you will see a complete builder area here and I will click on this again to see the sidebar coming to the Builder area now here is where you will have your requests and responses and in a moment we will see how to create a request and how to see the response we also have options for setting the environment and looking at the environments from here then we will can see the environment and variables from here and then again our settings option where you can manage your environment so this was builder and then if you come to the bottom status bar which is this area here this is the button to show or hide sidebar then we have this option for search so you can do an advanced search using this option you can also use regular expressions here then we have options to go to the postman console and this will be very handy and useful when you are debugging I will show you how to debug in postman so here you will see all your logs and everything then here we have a boot camp and learning so here you can just go and it will take you the learning process so you can see here let me show you this so you can see how to design walking api's designing and manual testing all these courses you can take and then here is a learning center then here let me close this so this is the builder then you can also browse to your API so as of now we do not have any API s-- then we have this button here to see a two pane view or a single pane view so when you click here you can see your request here so in the two pane view you will see a request here and a response here and in a single pane view you will see a request at the top and then when you run you will see our response at the bottom and then these are the keyboard shortcuts so you can see the shortcuts here and here we have a question mark this is for support and other links so you can see the support here security documentation release notes etc so this was all about the postman GUI and we have covered introduction we have covered what is postman how to download and install and we have also seen the GUI of the postman tool so now let us start with APA Web Services basics and I will show you how you can learn in case you are completely new to APA web services you can go on my website that is automation step-by-step calm and here here you will find a section on API testing and then here is a tutorial on API web services so this will take you to a YouTube playlist and here you will find all the tutorials on the basics of web services what is web service and basics of soap and rest and rest architecture all this you will find here so just in case you are completely new and you want to learn the basics you can go here and let us now go and create our first API request so for now I can create a new collection or I can directly create a new I will go to here new and click on new request so here we can give a request name and description so for now let me just go to google and search for REST API for testing I'm going to use a public available API and I'm going to this website req Arya start in and you can use any of your available API or any public API available to you I will also show you how to create a local API for testing but just for now let me go here and we have some examples here for get post put delete etc I will click on this get request and I will click on this request here so this is a get request this is the URI of the request or the URL and this is how we should get the response so I will copy the URL from here and let me give the request name as list users and description is optional and here because I have not created any collection it is asking me to create a collection I will click on create collection and let me say the collection name is examples and I will use this collection and save the request so now you can see we have got our request here and this is the area where we will create our request also if I go to collections now you can see I have a collection called examples and inside the collection I have list users API request so now I will copy the URL and provide this here and then you can see we have options for parameters or params and it has already taken param page equals 2 which is coming from here and then if you have any authorization like username password basic authorization or everything you can set from here now in this case we do not require any authorization we have headers any request headers will come here you can give the key value here then body we will need body in case of post port and pache as of now forget we do not need anybody we have pre request scripts here so you can create scripts that you want to run before running the actual request for example sometimes you want to get a global variable or do some settings or clear some environment variable all that we can do here and there are also some snippets so if we just click here it will auto generate the snippet for you that you can use and it will be very handy and all this will be in JavaScript again tests these are the tests that you want to run after you get a response for example if I just click here status code is 200 it will create a snippet for checking the status code is 200 after we get the response again this is JavaScript and here we have some templates and snippets that you can use and it will be very handy then we have settings and here you can do the settings and if you see here I am in a two-pin view here we have the request area and here is the response area in case I want to go to the single pane view I can click here and now it is a single pane where we have the request area here and response will come down and this will be the response area here so now I am on settings so here you can see we have settings for follow redirects or follow original HTTP methods and other settings as well so you can scroll down and see all these settings and then here we have option for cookies if you want to set any cookies for your request you can do it here and then we have option for code if you click here you will see our code for your request in different programming languages and tools and just in case you want to use it you can directly copy this from here and then you can use these codes so this will be handy in case you are using any external tools or IDs like if you want if you are using Java you can see this is the Java okay HTTP code and this is the Java you nearest code for our API request now I will go back to my request and everything is done I can save from here so to get saved in the collection and I can join now click on the send button so this will send our request and now I have got the response here you can see here is the response section and here I have got status as 200 ok time taken is 53 milliseconds and sizes 1.89 KB and then if I go here we have body cookies headers and test results if I go to body here you can see the response body and we have different formats here like a raw format preview visualize etc and here also you can change the format to JSON XML or whatever is available here then here you can wrap the line or unwrap it then we have response cookies so these are the cookies then the response headers and the test result so whatever test we have added the result will be shown here so our test status code is 200 days pass and therefore I am seeing this you can also filter out from here all past script field etc so this is how you can very quickly create a API test or a API requests in postman let us also see some more HTTP examples let me take a post example so I will click on new here and create a request I will say this is post or I can say create user posts for create and here if I go to the req Arrius website here we have some post example as well and just in case you want to see the HTTP methods the different HTTP methods you can go to google and search for HTTP methods and you can see some websites here and if you go here you can see for most is for creating so it will create a resource on the server and usually we get 201 as the response code of a successful post then we have get to read or retrieve the resource and we have 200 ok as the successful status code we have put to update or replace the resource we have patched to partially update or modify the resource and delete is to delete the resource or remove the resource so you can see these examples here then you can also see all this here so I'm going to use a post request from req arias and this is for creating a user so I will just click on this link so that I get the endpoint or the URI and I will say this is create user and I will save this two examples collection and then I will change the HTTP method to post here and give the URL and now here I do not have any authorization headers but I need to give our body in case of post so I will click on draw and copy the body or the payload from here and paste it here and here I will say this is a JSON format and you can see this has changed also if you want to change the font or increase the font you can go to settings and here if you go to the user interface you can increase the font from here so let me just increase the font so this is the body I'm not giving any pre request or test scripts and no settings required no cookies or code required so I will save and run the request and you can see we have got a response so here we have got a status code 201 which is for successful creation time taken two to seven milliseconds and size and here we have got the response so this is working fine so now we have a get and a post request letter create a put request and if I go here put his for abating the resource and I will create a new request and I will say this is update user and see if two examples and change it to put and then I have to use the resource URI which is this link and I also have to provide a body in case of put so I have to give the data that needs to be changed so I will just copy this from here and put it here and change the format to JSON and save and run and you can see we have got the response and here we have got status code 200 time and size and everything is fine so this is a simple put request now let me create a batch request now you can also directly click on this plus button to create a new tab and then you can create a request so I can create a batch request now I'll select batch and here I will take this example for patch this is the URI and I'll go to the body and give the body here and make it equals to JSON and now if you see it has not yet saved to the collection because we have directly created it from here so let me first save this and I can just say the name here so I can say this is partial update user and save to examples and now I will run and check so here I have got the response and everything is running fine now I will create a delete request I will click on this tab select delete and then here I will select a delete request and get the URI so here it is deleting a particular resource that is users and user with ID - and I do not need anybody or anything else for delete in case there is an authorization for your request you can give it here and then I will save it to my collection I will say this is delete user see if two examples collection and I will turn the request and you can see I have got result 204 is for successful deletion that is no content time taken and sighs and here you can see the headers of the response and there will be no body so this is a successful deletion so these are some examples how you can very quickly create all these API requests with postman now as of now we have used a public available api is and these are some fake api's so we cannot actually see our resource getting created when we do a post or a source getting updated when we do a put or patch so for that let us create our own API server and our own API and for that I will go to my browser and I am going to use JSON server so this is the github page the website for JSON server and I will also put this in the nodes all these nodes will be available to you so here you can create a full fake REST API using JSON server and if you scroll down you will see some documentation and here is the command to install JSON server now if you see it is a node program so therefore we are using NPM install - T JSON server so we will need node to be installed on our system so to check if node GS is installed you can go to your command line or your terminal in case of math and check node space - B or node space I fan - version in case you do not get the version of node that means node is not installed or set up on your system you can also check version for NPM so if node is not installed NPM will also not be there so we have to first install node GS you can go to Google and say download node GS and this will take you to the node GS website that is node.js dot o-r-g here you can download the installer as per your operating system now if I go to my Mac and go to the terminal and I say node space - V or node space - hyphen version I'm getting the version of node js I can also check NPM space - V and NPM is also setup here so I should also get a version for NPM so in my Mac it is already there so for Windows I will download the Installer and then I will run the Installer I will also show you in case of Mac in a moment so here I will say next and read and accept the license agreement and this is the location where node.js will go click on next and next and next and install you can also install node.js using chocolaty chocolaty is a package manager for Windows so you can use that as well in case you are on Mac you can again get the node.js for Mac so if you go to node.js download you can get the Mac installer and then you can run or a straightforward way will be you can use homebrew so I will say you can say you install node.js and here is a link that will show you all the steps so home view is a package manager for Mac and you can install homebrew first using this command you can directly go to your terminal and run this command it will install homebrew and then using home for you you can install node.js just by running this command drew installed node and it will install and set up node.js on your Mac operating system that will also copy this link here in the notes now on Windows the cistern I will click on finish and now if I go to my command line you should always check on a new command prompt so that it does not maintains the older session I will open a new command prompt and then I will say node space - V or board space - - version or NPM space - V and now nodejs is installed on the system so now I can run the command for installing JSON server so I will run this command I will copy this and go to my command line and paste it now you can do our global installation using the - G flag or I can also remove the - G flag and I will run this command so this will download and install JSON server so you can see this is done if you get some warnings this is fine you should not get any errors and now to start JSON server this is the command and here you can see we have a file called DB dot JSON here we will have our data for the REST API and in case you do not already have DB dot JSON file created it will create the file with some dummy data so let me just copy this command and I will run this here and let us see it is saying JSON server is not recognized let me exit from here and open a new command prompt now I will run the command here so it is not yet recognized so let me try again let me try with the - G option I'm going to install JSON server again using - G option and looks like should be fine now if I try now so you can see now it is started and also it is saying that DP dot JSON doesn't exist and therefore it is creating DB dot JSON with some default data and you will find DB dot JSON on the same location where you started JSON server so in my case it is C users administrator if I go to see users administrator on my system and I should see is debbie dot JSON file so I will go to see users and administrator and here is the DB dot JSON file and if I open this file in any editor like notepad plus plus you will see the data here so here it has created a API or REST API with three resources posts comments and profiles and the same we should see on the server so this is the server location or the URL from where you can invoke the server and check the data so if I go to localhost 3000 on my system I will just go here on the browser so I will go to localhost 3000 and here you can see it is saying you are successfully running JSON server and here you can see all the three resources so let me also show you in a split window so here is my file with the data and here Alta here is the URL or the browser I can also I will just close other I will close other tabs and here now if I go to forward slash posts you can see it will show me the posts so here it is showing me this resource and similarly I can see other resources now this is our dummy data let us create our own API from scratch so I will remove everything from this file now I'm going to create our own REST API so I will create as JSON data so it starts with a curly bracket start and stop and then I will create a resource for users so this will be an array so I will give a square bracket start and a square bracket stop and inside this I will create the data so I will again give a curly bracket start and the curly bracket stop and then I will give the data for user so let us say I need first name here and I will give the value and a comma then let us say last name colon and the value and then again a comma then let us say I want to give a subject ID and so what I'm going to do is I'm going to create another resource called subjects and I can do the referencing of the subjects resource and the users resource and I will show you that in a moment so let us say subject ID is 1 and I will also give the ID for this user and I will say the ID for user is 1 so this is the users data I will save the file and now if I go to localhost 3000 on my browser so let us see you can now see it has our users resource now and one X means there is only one entry or one user in this resource or one data in this resource and if I go to forward slash users on the browser here it will show me the data of the users resource so this is working fine let me create some more users here I will copy this give a comma here and then paste make sure the syntax should be correct just in case if you are not able to see your data on the browser go to your command line hand check you will see some error message here and then you can correct your syntax here so now I will create a new user I will say this is gee and I will give Ford here I will say subject ID is - and I will say user ID is again - again I will copy this give a comma and say this is Albert Einstein and then I will say subject ID 1 and user ID is 3 and save it and now if I go to user stay source and refresh my browser you can see I am getting these users here let me also show you like this I will zoom it so we are able to see the users here now I am going to create another array or another resource called subjects so after this square bracket close of users I will create a resource for subjects and a colon and a square bracket start hand a square bracket close now inside the square brackets I will give a curly bracket start and a curly bracket close and then inside the curly bracket I will give name of the subject and I will say this is automation then I will give a ID of the subject and I will say the ID is 1 and then I will also create another subject so I will copy this give a comma and paste and this I will say is DevOps and then subject ID is 2 now you can see I can do a referencing between these resources this is subjects resource and here we have a user's resource where we have a subject ID so now if I say here forward slash subjects I should see the subjects and let me save this and check again yes we are getting the subjects here and now in case I say here forward slash subjects forward slash one this will show me subject one which is automation and if I say forward slash subjects forward slash one and I say forward slash users this should show me all the users that have subject one so if I run this you can see I'm getting two users so you can also do like this also I can say forward slash subjects and then I can give some parameters I can say a question mark and I can say name equals automation and if I run this so I think I do not need the quotation marks here so if I say forward slash subjects and question mark name seeker name equals automation I am getting the resource having the name automation so this is how you can create and check a REST API now in this case we are we are only able to run the get request we can also run the post request using postman so now I will go on my postman and let us create a new collection first so I will go to new and click on collection and I will say this is examples for local API and create the collection and the collection has come here now I can create a new request inside a collection I can also create a request from here I will say add request and let me first create a very simple get request I will name it as get and I'm just going to get the user's resource so I will say forward slash users here and I will get this URL and add it here can also close all other tabs I will say close other tabs I'll give the URL here and again we do not have any authorization or head on so I will just click on send and here we should get that result so I am getting the users data here so this is running fine now let us try to create a new user using post so I will again create a new request and I will say this is post and save to the collection and make it a post request now I'm going to create a new users so the URL I have to use is forward slash users so I will just copy the URL from here and then here I have to give our body as well so I will give the body and this is how we have to give the body these are the details of the user that we have to provide so I will copy this and add it here we do not need the ID ID will be auto-generated so we just need these three data first name last name and subject ID you can make it to a JSON format and then we also have an option to beautify the data so I will click beautify and let me create some data here I will say drum Bell this is the user I want to create and I will now send the request and you can see the response I have got status code 201 that is for successful creation and the user is created so now if I go to my browser and refresh the browser you can see a new user created here if I go to my file I will reload the file and you can see a new user is now created here now let us also do a put I will create a new request and I will name this as put and I will save to the collection and this is put and put is for modifying the resource so let me try to modify the resource or the user we just created so for that I have to give the URI or the Uniform Resource locator of the resource which is forward slash users and forward slash 4 so this will give me the user with ID 4 and you can see this is showing me the user I will copy this and paste it here and now I have to give you a body that will get updated so I will say here I am just going to copy the data from here and add it here and make it equals to JSON and beautify I do not need the ID I will say first name is tamas and last name is Edison and I will keep the subject ID 2 1 and I will now send that request and let us see the response so we have got the response and we have got status code 200 and here it says it gives me the updated resource here if I go to my browser and if i refresh so you can see it has changed the data here also if I go to my file and if I reload the file you can see the data is also changed here so put is working fine now let us try a batch request patches for partial modification so I will say this is patch and save in the collection and change the HTTP method to patch and again I have to give the URI so I am going to use the same user and here in the body let me just go and change the last name so I will use this last name I will say here last name and I have to give this within the curly brackets and I will make this to JSON and beautify so I will say I'll change last name to Parker and run this and this is running fine I'm getting status 200 and the resources changed or modified if I go to my browser and refresh so you can see this is changed if I go to my file and reload here again you can see that this source is updated here so put is working fine now I will do our delete so I will create a new request for delete and save to the collection and select delete from here and then again I have to give the URI of the resource so I will copy this and paste it here and for delete I do not have to give any body or other things you can give authorization or headers if required but in this case I do not need that so I will just send that request and let us see the output so you can see I am getting the response and I am getting status 200 which is fine if you get 204 that is also okay for delete and there is no resource so that means it is deleted and if I go to the browser and refresh you can see there is no resource with user ID 4 and the same thing if I go here and reload you can see the user with ID 4 is now deleted so this is how you can use a local API and test all this now if you see here I'm getting all this as get and I'm not getting the different HTTP method that is because it is not saved I will have to save all these requests so I will go and just click on save for all these requests and save and now you can see Oh all these different HTTP methods so in this part we have just get started with using postman and we have got familiar with postman how to run request with postman in the next part we will see some more features and some more functionality of postman I hope all this session was very useful for you in case there is any doubt or any issues you face you can let me know in the comment section below also share your knowledge with others if there is anything to be improved you can let me know in the comment section and I will try to improve in the next session I hope all of this was very useful thank you for watching
Info
Channel: Automation Step by Step
Views: 116,330
Rating: undefined out of 5
Keywords: postman beginner tutorial, postman 2020 beginner tutorials, what is postman, how to use postman for api testing, api testing for beginners, how to run api request in postman, what are web services, what are collections in postman, how to create local rest api for testing, postman from scratch, postman step by step, postman by raghav
Id: J5l2fepRelk
Channel Id: undefined
Length: 51min 34sec (3094 seconds)
Published: Mon Mar 23 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.