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?

asked Jul 10, 2021 at 9:55

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

answered Jul 10, 2021 at 10:21
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? Commented Jul 10, 2021 at 10:29

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.