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?

  • Can you share the response you are getting back?
    – Trimes
    Jul 7 '21 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 '21 at 13:19

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

Header ==> Content-Type application/json

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

  • 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 '21 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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