AbanteCart Community

AbanteCart Development => API Development => Topic started by: Rawinder Dhillon on August 01, 2020, 03:37:48 PM

Title: getting 401 unauthorized response from API
Post by: Rawinder Dhillon 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
 
Title: Re: getting 401 unauthorized response from API
Post by: Rawinder Dhillon on August 03, 2020, 02:23:36 PM
problem solved by sending data in x-www-form-urlencoded format
Title: Re: getting 401 unauthorized response from API
Post by: Basara on August 04, 2020, 01:38:39 AM
Thank you for posting your solution