0

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

End point POST / rest / <store_code> / V1 / integration / admin / token

Headings Content-Type / json app

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

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

2
  • Can you share the response you are getting back?
    – Trimes
    Jul 7, 2021 at 22:15
  • <html> <head> <title>401 Authorization Required</title> </head> <body> <center> <h1>401 Authorization Required</h1> </center> <hr> <center>nginx</center> </body> </html> Jul 8, 2021 at 13:19

1 Answer 1

2

POST ==> https://example.com/index.php/rest/default/V1/integration/admin/token

Header ==> Content-Type application/json

Body ==> raw {"username": "name", "password": "password"}

1
  • Thanks for your reply. I used a similar method. But it doesn't work. I got: "401 Authorization Required." Everything worked fine before. Jul 10, 2021 at 9:50

Your Answer

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

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