You can use Newman and the Postman API to run Postman Collections in your continuous integration (CI) environments. You must first install Newman and Node.js, and then you can run Newman to get your collection using the Postman API.
Before you get started, check the following prerequisites for accessing collections using Newman and the Postman API:
Developing an API? Postman offers built-in tools to integrate your API with some of the most widely-used continuous integration (CI) tools. After you set up CI for your API, you can view the status of builds or kick off a new build, all from within Postman. You can also use Newman to run API tests as part of your CI pipeline. To learn more, see CI integrations.
To learn how to install Newman and Node.js, see Install and run Newman.
You don't need to install Node.js if your CI environment already has it installed.
To run Newman and use the Postman API to access your collections, run the following command:
$ newman run "https://api.getpostman.com/collections/collection-id?apikey=postman-api-key"
If you need to provide an environment to the collection, add the --environment
option with the appropriate parameters to the Newman command:
$ newman run "https://api.getpostman.com/collections/collection-id?apikey=postman-api-key"
--environment "https://api.getpostman.com/environments/environment-id?apikey=postman-api-key"
Last modified: 2023/10/05
Additional resources
Videos
Blog posts