My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
A simple way to document your API with postman

A simple way to document your API with postman

Ayooluwa OYEWO's photo
Ayooluwa OYEWO
·Aug 31, 2019

Usually, when working on a team of developers as a backend developer there is a need to provide a succinct documentation of the API you just developed, as much as there are lots of documentation options I found using postman documentation quite easy, stressless, and fast.

Before you start using Postman to test your API endpoints, I will advise you to create a collection for your API endpoints. You can do that by clicking the collection tab on your postman app, fill in the details required into the dialog box, then create the collection like so:-

selectcollection.png

selectcollection1.png

After creation, you can begin to add your requests to your collection like so:-

createrequest.png

createrequest1.png

createdcollectionandrequest.png You can then begin to test your API endpoints.

I am going to use an example here, I have a server running already and an endpoint that signs in a user

http://localhost:3000/api/v1/users/signin/

After getting the required response click on the save buttons adjacent the send button and download button in order to save your endpoint, request body and response like so:-

saverequest.png

saverequest1.png

You can then go back to your collection and generate your documentation by clicking the < button adjacent the collection, then click view in web button on the dialog box like so:

generatedoc.png

You will notice a new browser window open up like so:-

Screenshot from 2019-08-31 13-44-59.png

Screenshot from 2019-08-31 13-45-39.png This shows your endpoint, request body and response example. You can share this documentation by generating a unique public link by clicking the publish button on the upper right corner of the page like so:-

publishdoc.png

publishdoc1.png

Publishedurl.png You can then copy and share the PUBLISHED URL with anyone that needs the API documentation.

Here is the one I just generated Example Collection.

If you understood and enjoyed this post or you have comments, do well to let me know.

Thanks for reading.