- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2021
09:06 AM
04-11-2021
09:06 AM
Magento REST request Postman setup
Hello,
I want to create product attributes and attribute sets automatically, because I have many of them. I decided to use the REST API from Magento (v2.4), because it seems quite powerful and when I have learned how to use it, I could automate more stuff.
Unfortunately, I am getting stuck at the very beginning. I am trying to setup Postman to test some simple (standard) REST requests.
I was able to generate a token using the following Postman config:
POST https://myshop.com/rest/V1/integration/admin/token Headers: "content-type": "application/json" Body: { "username": "user", "password": "pass" }
Now I obtained the token, but every following request gets a 400 Bad request response.
Sample request:
GET https://myshop.com/rest/v1/products/attributes Authorization: Bearer: "hl0xddpqfkno8uheyj7pnja8h2upok59"
Headers: "content-type": "application/json"
Response body:
{ "message": "Specified request cannot be processed." }
I also don't know where to look for the cause of the problem.
Labels: