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– Trimes2021年07月07日 22:15:42 +00:00Commented 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>Ihor Radzyil– Ihor Radzyil2021年07月08日 13:19:40 +00:00Commented Jul 8, 2021 at 13:19
1 Answer 1
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.Ihor Radzyil– Ihor Radzyil2021年07月10日 09:50:28 +00:00Commented Jul 10, 2021 at 9:50