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?

asked Jul 7, 2021 at 18:16
2
  • Can you share the response you are getting back? Commented 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> Commented 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"}

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

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.