I want to subscribe to the pro version of Postman but somethings is getting on the way.
With my application, I generate a swagger file in json that I can successfully import with the API (https://docs.api.getpostman.com/?version=latest#09886971-e1e2-4a62-8f59-f7abfd79ff5e) in my personnal workspace, but I want to share the new import collection in a shared workspace using the API. It is important that everything will be done with the API, because I want the operation to be automatic in the CI.
I try to put the url parameter ?workspace={workspace_id} but without success.
Great question! So using the URL parameter won’t work, because their API specification doesn’t seem to allow it.
However, I just did some research and thought of this.
To share the the newly imported collection, get the collection ID, do a PUT on the workspace, and insert that collection ID into the body of the PUT call, and that may then share the collection with that team/shared workspace.
This is even better than creating a new collection each time I import a swagger file, because I can keep all by the collection preferences that are only available manually, like publishing.