How to import Swagger APIs into Postman?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so now for this video we will be seeing how we can integrate the Swagger API into our Postman and use that API easily and seamlessly uh within a few just few clicks and you are done you are in integrating the whole Swagger API into the postman okay so the API that we are going to use for this video is the Swagger for patch store API okay so the base URL that they have given over here you can see and if if you want to get a get over this page just uh head over to the browser and write pet store.swagger.io and then you can get to this landing page of the pet store API okay so we will be integrating this Swagger API into our Postman and we'll see how we can integrate and run the different uh methods that this API offering us okay so there are both posts get delete all these methods this API gives us and various sections also they are like pet section store section user section will see how we can use these API methods and how we can call this within just few clicks okay now to integrate this you have to get here and just select this text and copy this okay so this is the URL for this API just come here and copy this okay so I will be showing you two methods how you can integrate this Swagger pet store API into the postman okay so we will see the first method now you just copy this okay after copying this come out head over to this Postman dashboard and over here again click click either click Ctrl o to get your import tab or click on this three dots file and then import okay and now just paste your url over here it the post menu automatically detects that it is a URL and give you a prompt choose how to import your API okay so I will be using the postman collection itself I will not go with the open uh open API 2.0 we click on the postman collection and I will hit import as soon as I will hit import it it will start importing the API into my Postman and it will create one collection if you can see a Swagger pet store collection and inside that it will get me the paid store user the same way that they have given over here pet store and user the same way I have imported all those methods all the support post get methods Arc store inside store order is there order ID is there like all these methods are I have imported in just one click uh like you know previous video we have seen how we come here how we see how the documentation we have seen we have copied this we have pasted over there but all this hectic part I've done with just one URL and I have integrated this Swagger pet store API into our Postman okay so this is the one way you can do the another way I will be telling you now just I'll let me delete this first okay so collection deleted now uh one more way you can achieve this uh integration is just copy this and just head over to a new tab and just paste this over here after pasting this once you paste okay so this is my uh one Chrome extension by which I can get the this pretty beautiful way structured way of the entire Json object I can get the three three object as well if I just click here and Ctrl a and Ctrl C I will copy all this entire Json object document I will just go here and I again I click Ctrl o or command 1 for command o for mac and if I click here you can and it's your back online okay now I am online oh I know I don't know why it's getting error okay so I once I click paste as soon as I click all paste entire document or inside the tab it will automatically detect that it is a Swagger pet store API and it will give me option to import that okay so same way I have imported entire uh that API over here and I have imported all those methods put post get delete all those methods over here itself okay now we will see one method we will see and run one method inside our Postman now okay so first of all uh I will go here into my Swagger here so I got a pet store API and I will see how we can create a new pet okay so if there is a post method that says add a new pad to the store okay so slash pet is the end point okay so I will go here and inside pet there is an post method similarly as we have seen in the browser I will click on that and you can see the beauty of importing the or integrating the Swagger API right in the post manage you can you will get all the URL in a very PT formatted way you just need to uh replace this base URL with the URL that they have given to you over here over here you can see base URL they have given pet store dot swagger.io.v2 okay just copy this and one more thing uh one more uh good feature of Postman is if you hover over this base URL you can see uh it is it a postman is also detecting or giving you the entire base URL over here also you can just click on this copy and paste it I uh but I am I have pasted from the browser I will just go ahead and select this and instead of Base saying base URL I will just paste That Base URL over here okay so now uh one thing I have to do is since it is a post method uh the it it should accept one Json object then if I go here and one more thing the entire the entire post object that it is going to ask accept is also pretty formatted in this uh section you can see that is the beauty of importing the or integrating the Swagger apis into your uh Postman collection okay you will get all this in the pretty formatted Manner and if you just go here and here also you can see then they have given you one dummy sample this one section that they have told you to to pass the Json object like in this manner then the same manner we have seen over here itself okay so just go here go ahead and change this parameters so instead of changing all these parameters what I will be doing is just copying this entire and just Ctrl a and Ctrl V over here okay okay and I will as soon as I hit send okay method not allowed okay we have seen just yeah we'll stick with the older version itself if I hit send okay okay wait wait wait I have to pass the entire URL I guess that's why it is not working let me just copy and let me just paste it over here itself Swagger dot IO okay so I will dot IO slash Widow slash pet okay now if I hit send a known something bad happen server error is there okay let me just copy this document now I can try and paste it over here and if I hit send yeah now you can see I have uh get this Json update from here and paste it over here and it has created one pad for me with the ID this long okay so I will just copy this ID because I need that ID later okay now since I since we have created one pet now we have to we can get that paid by his ID there is one get method that you can see over here find pet by its ID I will just click over here okay and now again the entire URL is pretty formatted in the postman itself I will just go ahead and get my base URL from here from the last request that we have made and I will just paste that my base URL over here okay so they have also given the parameters over here path path parameters okay we have seen uh parameters in our previous video If you haven't watched that video go ahead and watch that video now insert instead of the pet ID we have I have to pass that ID over here okay so I will just paste that ID uh over here let me just go ahead and get that ID first let me just copy this and I have to paste this entire ID over here okay as soon as I paste the ID and hit send we can see the entire pet details that I am getting over here by the ID itself and the same pet object I have received as a input from here as well when I am trying to create that bit okay so this is how you can integrate the Swagger apis uh when we when I have show you pet store API and one more API that we have used is bookstore API go ahead and try to import this or integrate this bookstore API in the Swagger app uh in the port in your in your Postman and I hope you like this series uh thank you for watching this video and I'll see you in the next one
Info
Channel: ProgrammingKnowledge
Views: 20,286
Rating: undefined out of 5
Keywords: import swagger json to postman, swagger to postman converter online, postman import swagger format not recognized, swagger vs postman, postman import openapi, postman-to swagger npm, convert postman collection to swagger free, postman swagger documentation
Id: B3DndCaYgyM
Channel Id: undefined
Length: 10min 38sec (638 seconds)
Published: Fri May 05 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.