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.
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.
Open your console, and trigger following CURL requests.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*******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
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
Post a Comment