Is there a programmatic way to export Postman collections?

I have an ever-growing collection of Postman tests for my API that I regularly export and check for source control, so I can run them as part of CI through Newman.

I would like to automate the process of exporting the collection when I added some new tests - maybe even pull it regularly from Postman servers and check out the updated version on git.

Is there an API I can use to do this?

I would happily settle for a script I could run to export my collections and environments to json file names.

+3


source to share


2 answers


A feature like this should be available in Postman Pro when you use the Cloud Instance feature (I haven't used it yet, but I probably will do for continuous integration), I'm also interested and I went through this information:

FYI, you don't even need to export the collection. You can use Newman to talk to a Postman cloud instance and invoke collections directly from there. Therefore, when a collection is updated in Postman, Newman will automatically start the updated collection the next time it starts.

You can also add environment URLs to automatically update Newman environment (we use this to run the healthcheck collection in all of our [Dev, Test, Stage and Prod] environments)

You should check this feature, postman licenses are not particularly expensive, it might be worth it.



hope this helps

Alexander

+1


source


You may have already solved your problem, but for everyone who has come across this, Postman has an API that allows you to access information about your collections. You can call / collection to get a list of all your collections and then query them by their ID. (If the link doesn't work, google the Postman API.)



0


source







All Articles