Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a programmatic way to export Postman Collections?

Tags:

postman

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

I'd like to automate the process of exporting the collection when I've added some new tests - perhaps even pull it regularly from Postman's servers and check the updated version in to git.

Is there an API I can use to do this?

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

like image 297
GarethJ Avatar asked May 24 '17 03:05

GarethJ


1 Answers

Such a feature must be available in Postman Pro, when you use the Cloud instance feature(I haven't used it yet, but I'll probably do for continuous integration), I'm also interested and I went through this information:

FYI, that you don't even need to export the collection. You can use Newman to talk to the Postman cloud instance and call collections directly from there. Therefore, when a collection is updated in Postman, Newman will automatically run the updated collection on its next run.

You can also add in the environment URLs to automatically have Newman environment swap (we use this to run a healthcheck collection across all our environments [Dev, Test, Stage & Prod])

You should check this feature, postman licences are not particularly expensive, it can be worth it.

hope this helps

Alexandre

like image 176
A.Joly Avatar answered Oct 16 '22 01:10

A.Joly