postmanlabs / openapi-to-postman

Plugin for converting OpenAPI 3.0 specs to the Postman Collection (v2) format
Apache License 2.0
924 stars 199 forks source link

Is there any API for Export Postman Collection v2.1 by APIkey and CollectionID? #751

Open spamnick opened 1 year ago

spamnick commented 1 year ago

Idea: I want to convert automatically Postman collection to Swagger YAML file

I want to run automatically pipeline:

So...

I found this for Export Postman Collection v2.1, but is not automation process: https://learning.postman.com/docs/getting-started/importing-and-exporting/exporting-data/#exporting-collections

Is there any API for Export Postman Collection v2.1.json by APIkey and CollectionID?

habibur4340 commented 9 months ago

Hey @spamnick ! Yes, you can export a Postman Collection v2.1 using the Postman API by leveraging your API key and the Collection ID. Simply use the Postman API's "GET" request to fetch the collection. Here's a quick guide:

Get Your Postman API Key: First, obtain your Postman API key from the Postman dashboard under your account settings.

Find Your Collection ID: Your Collection ID can be found in Postman under your specific collection details.

Make the API Request: Use the following endpoint to get your collection: GET https://api.getpostman.com/collections/{{collection_uid}}. Replace {{collection_uid}} with your actual Collection ID. Don't forget to include your Postman API key in the header for authentication.

Export the Collection: The response will be the JSON representation of your collection, which you can then save or use as needed.

For a more comprehensive solution, I recommend checking out Apidog. It's a tool designed for managing and synchronizing API documentation, which might offer additional functionalities that could be beneficial for your use case, especially when dealing with API collections and documentation.