AbanteCart Community

Shopping Cart Operations => Support => Topic started by: praveenbaranwal on March 28, 2016, 02:19:27 PM

Title: Login API is working fine but Account details API give 401 error
Post by: praveenbaranwal on March 28, 2016, 02:19:27 PM
I am trying to login using below API calls in postman client where i get the response as expected.
Req type: POST
URL: Target URL
Body has following parameter
email: praveenbaranwal
password: praveen123
api_key: sweedelight800
rt: a/account/login

I am able to get the login Success with response code 200.

Next i wanted to validate my login:
Req type: POST
URL: Target URL
Body has following paramater
token: use the value received in step 1
api_key: sweedelight800
rt: a/account/login

I am getting the response code as 200 and Authorized.

The same query was sent using a java class file created (Attached java class file) but i am getting error in the 2nd part where i am trying to validate if i am logged it.

I am not sure if token will be sent as header (if yes how?).

Regards,
Praveen
+91-9739048200



Title: Re: Login API is working fine but Account details API give 401 error
Post by: abantecart on March 28, 2016, 10:12:48 PM
I wonder if your Java class pass session/cookie in the request. How do you pass token back to the next request?
Title: Re: Login API is working fine but Account details API give 401 error
Post by: abolabo on March 29, 2016, 07:59:45 AM
you can enable Debug mode in your Abantecart settings with output to log-file.
Also you can add your own logging inside api-controllers to recognise all environment variables
Title: Re: Login API is working fine but Account details API give 401 error
Post by: panthersam on May 17, 2016, 07:50:13 AM
Hello praveenbaranwal,

I need a help from you.How can i make big search bar like your site.Can you suggest me .
Title: Re: Login API is working fine but Account details API give 401 error
Post by: praveenbaranwal on May 17, 2016, 12:36:44 PM
Hi Sam,

You can edit the Search field size by
1)goto file: public_html/storefront/view/default/stylesheet/style.css
2) Search for
.top-search input {
   width: 100%;
   border: 4px solid #F5F5F5;
   padding: 6px;
   float: left;
   vertical-align: middle;
}
Now edit the width % based on your choice. You can also choose where to keep the search box (Left or right)

Hope this helps.

Regards,
Praveen
Title: Re: Login API is working fine but Account details API give 401 error
Post by: Rawinder Dhillon on August 04, 2020, 02:54:01 PM
parveen , did you solved the problem ???
Title: Re: Login API is working fine but Account details API give 401 error
Post by: Rawinder Dhillon on August 21, 2020, 04:09:51 PM
dont know it is helpful or not for parveen now but may be helpful for someone else :-)
i solved this one
in 2nd step use
rt: a/account/account instead of rt: a/account/login
and we need to send cookies in headers that mainly include session and customer cookies that we received in step 1.