Save and Document WebSocket Requests in Collections

Earlier this year, we added support for WebSocket and Socket.IO, enabling debugging and testing for these new request types. Since then, we have been working towards adding the ability to document and save WebSocket requests within Postman Collections.

We are excited to announce that with our latest release, you can now save and document your WebSocket requests within a collection. This capability is built as a foundation for our upcoming improvements to support more synchronous and asynchronous protocols.

Saving a WebSocket request in a collection

From a WebSocket request tab, click Save in the header(or, ⌘ + S) to open the request save modal. You will notice that it asks to create a new collection for saving WebSocket requests.

Click Create collection and name your new WebSocket collection. Finally, name your request and click Save.

Saving a WebSocket request in a collection
How to save a WebSocket request in a collection

For the moment, you will need to create a new collection and exclusively store WebSocket requests in them.

Saving WebSocket messages

A WebSocket request is incomplete without the messages that the API accepts. To save your very first message, click Save Message and give your message a meaningful name, then hit Enter.

Saving WebSocket message to a request
How to save WebSocket messages

To draft a new message, switch back to the Compose Message and author a new message.

Pro Tip: You can save messages from the messages stream as well by hovering over a message and clicking the save icon.

Documenting your WebSocket APIs

As you’re probably familiar with, a Postman Collection also acts as your API documentation, and these collections are no different. You can document your collection and requests to help your API consumers better understand the APIs.

In a request tab, you can access the documentation from the context bar on the right. You will notice your API documentation is autogenerated from the saved request and the messages:

Documenting WebSocket request
WebSocket API documentation

For Socket.IO requests, you can supercharge your API documentation with the help of events. In the Events tab, add the events associated with the request and in the documentation view, the saved messages automatically get categorized by the event names.

Documenting Socket.IO request
Socket.IO API documentation

What’s next?

The ability to save and document WebSocket APIs was, in fact, the most requested feature after our initial WebSocket release. It is still the first step for asynchronous APIs to nestle within the API lifecycle, and we’ll be incrementally adding support for more features like scripting, testing, and forking.

We would love to hear your continued feedback so that we can keep creating and evolving what helps you to build faster and better. We invite you to participate in the Postman Community forum discussion around WebSocket support and follow our GitHub issue tracker link in order to talk to us about improvements, ideas, and issues. Finally, we’re excited to see your WebSocket APIs, so share them in public workspaces.

Try Postman now


What do you think about this topic? Tell us in a comment below.

Comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

2 thoughts on “Save and Document WebSocket Requests in Collections

  • Very good! Very grateful for these features.
    It would be great if we could save websocket connections in collections where there are REST API requests!

    Sorry for my bad English.

  • Which version of Postman will this feature be available in? I’m using v9.0.7 and it says it’s the latest version, but if I try to save a WebSocket request, it still says “Coming soon”. Thanks!