Author Topic: getting 401 unauthorized response from API  (Read 4703 times)

Offline Rawinder Dhillon

  • Newbie
  • *
  • Posts: 24
  • Karma: +5/-0
    • View Profile
getting 401 unauthorized response from API
« on: August 01, 2020, 03:37:48 PM »
i'm not a php developer , but can understand php code
problem is i'm trying to login through API. As i understand it , it includes 2 steps , first send email , password and api_key through Post Url
htps://MYDOMAIN.com/?rt=a/account/login&email=xxxxxx@gmail.com&password=xxxxxxx&api_key=12345
according to me , it will hit login.php & return me a Token and code 200.(as i can see from login .php in API Folder )
but it is returning 401, unauthorized
Now the questions are ?
M
ay be it is due to first step and yet no functionality  for resend data with tokens, but how can i get token in first step?
as i'm not getting one, i thought it is in the form of json , and  as response of command .


*with text_api.php i'm able to login with customer credentials
** Able to fetch Product with Get Command from Browser
 

Offline Rawinder Dhillon

  • Newbie
  • *
  • Posts: 24
  • Karma: +5/-0
    • View Profile
Re: getting 401 unauthorized response from API
« Reply #1 on: August 03, 2020, 02:23:36 PM »
problem solved by sending data in x-www-form-urlencoded format

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5774
  • Karma: +274/-2
    • View Profile
Re: getting 401 unauthorized response from API
« Reply #2 on: August 04, 2020, 01:38:39 AM »
Thank you for posting your solution

 

Powered by SMFPacks Social Login Mod