TIP: Postman: HOWTO Copy an API Request to a decoupled Collection Request and customise its parameters (or expose specific parameters to drive as Ports on Flows)

Icon class
icon_class
far fa-sticky-note
icon_class_computed
far fa-sticky-note
Note kind
Policy level
Keywords

Here the term API Request means a Request that is loaded via an API Definition (such as using an Open API JSON file), accessible via the APIs tab in the left sidebar. A Collection Request is a Request that is under a Collection accessible via the Collections tab in the sidebar.

Consider an API Request that has specific settings that are used across many Flows. What happens if you wish to expose one parameter as a Port for use in a Request block in just one Flow, but you don't want to break the usage of that API Request in all the other Flows that use it?

You can create a decoupled version of the Request by "copying" it to a Collection using the following steps:

  1. If you don't already have a Collection, create one.
  2. Go the main settings view for the API Request you wish to adapt.
  3. Run it. It does not matter at all whether it actually runs OK (whether, for example, it has {{var}} parameters that are not set)
  4. It will appear in the History
  5. Select it in the History, click the triple-dots ooo (...) menu item and choose Save Request
  6. Save the Request to your Collection.

You can now use that decoupled Collection Request in your specific Flow instead of the API Request version. So, for example, you may choose to set a particular test value under the Request settings, or you may wish to expose it as a {{var}} variable so you can drive it as a Port in your special test Flow . Make sure you Save any edits, otherwise they won't show up on the Request block in the Flow.

Note that the Collection Request is now truly decoupled from your API. If you make changes to the API End Point, you may have to add or remove parameters "by hand" for future use.

Relates to
Related notes
Related notes (backlinks)
Related snippets (extracts)
Visit also
Visit also (backlinks)
External links