一共三步
- 通过后台账号密码 或者token
curl -X POST "http://m2.host/index.php/rest/V1/integration/admin/token" -H "Content-Type:application/json" -d '{"username":"admin", "password":"your-password"}'
- 通过token 获取所有API json
curl -X POST http://m2.host/index.php/rest/default/schema -H "Authorization: Bearer idcfdipbei9ydpoobgns7tl0uhvaur10" > magento2.api.schema.json
- 导入到postman
通过postman 左上角 , 导入 magento2.api.schema.json 到postman
Magento2 API Token获取与使用
本文介绍如何通过后台账号密码或token获取Magento2的API访问权限,包括使用curl命令行工具获取token,通过token获取所有API的JSON格式文档,并指导如何将API文档导入Postman进行进一步的开发和测试。
435

被折叠的 条评论
为什么被折叠?



