0

Magento 2: I want to get admin or customer token via Rest API. Early I used:

End point POST / rest / <store_code> / V1 / integration / admin(or customer) / token

Headings Content-Type / json app

Payload { "username": "admin", "password": "123123q" }

But now this method doesn't work. Can anyone please help me?

1 Answer 1

0

try below API

Use Content-Type - application/json

Create Customer Token

http://127.0.0.1/rest/store_code/V1/integration/customer/token

Body

{
  "username": "[email protected]",
  "password": "xxxxxxx"
}

Create Admin token

http://127.0.0.1/rest/store_code/V1/integration/admin/token

Body

{
  "username": "admin",
  "password": "xxxxxxx"
}

Make sure username and password are correct or not and store code also.

For checking store code go to store > all stores

enter image description here

1
  • Thanks for your reply. But I used a similar method. And it doesn't work, although it worked without problems before. I am guessing that something may have changed in the Magento 2 API. Could you confirm that this method works at the moment? Jul 10, 2021 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.