Magento 2: How to automatically generate Postman Schema for Default Magento 2 APIs

In order to automatically generate the Postman Schema for all of the Default Magento 2 APIs, follow below steps:

Open your console, and trigger following CURL requests.

*******TO GENERATE THE BEARER TOKEN*******
curl -X POST "http://localhost/index.php/rest/V1/integration/admin/token" \
-H "Content-Type:application/json" \
-d '{"username":"admin", "password":"your-password"}'
*******TO GENERATE THE POSTMAN SCHEMA*******
curl -X POST http://localhost/index.php/rest/default/schema \
-H "Authorization: Bearer ADD_YOUR_TOKEN_HERE" > magento2.api.schema.json
view raw curl.txt hosted with ❤ by GitHub


This will generate a JSON file in your root directory. Now, Open Postman app > File > Import > Select the JSON file generated above and Voila, you now have the Schema of all Magento 2 APIs.

Comments

Popular posts from this blog

SEO for your Press Releases [Updated 2025 list]

XDebug - PHPStorm - Mac: How to configure Xdebug with PHPStorm on Mac OS and PHP 7.3