Page 1 of 1

Can't login using API on OpenCart 3.0.2.0

Posted: Thu Jan 02, 2020 5:45 pm
by ransom1
Hello,
I am trying to login to use the API on my store, and when I try I get this error:

Notice: Undefined index: api_token in /catalog/controller/startup/session.php on line 8

I'm following the documentation here:
http://docs.opencart.com/en-gb/system/users/api/

Passing the username and key but I get this error. Does anyone know how to fix it?

Thanks!!

Re: Can't login using API on OpenCart 3.0.2.0

Posted: Thu Jan 02, 2020 9:14 pm
by straightlight

Re: Can't login using API on OpenCart 3.0.2.0

Posted: Fri Jan 03, 2020 5:52 am
by ransom1
Thank you for your response.

That fix didn't work for me, unfortunately.

My admin/view/template/sale/order_info.twig doesn't have the code that the post says to change.

I made the specified changes in admin/view/template/sale/order_info.twig but I am still getting the same error message:

Notice: Undefined index: api_token in/catalog/controller/startup/session.php on line 8

Re: Can't login using API on OpenCart 3.0.2.0

Posted: Fri Jan 03, 2020 6:35 pm
by paulfeakins
ransom1 wrote:
Thu Jan 02, 2020 5:45 pm
I am trying to login to use the API on my store
What exactly are you trying to do? Just edit products?

Re: Can't login using API on OpenCart 3.0.2.0

Posted: Fri Jan 03, 2020 6:37 pm
by ransom1
I'd like to add products to the cart.
But at this stage I can't manage to login to the api and get my api token.

Re: Can't login using API on OpenCart 3.0.2.0

Posted: Sat Jan 04, 2020 9:48 pm
by straightlight

Re: Can't login using API on OpenCart 3.0.2.0

Posted: Sat Jan 04, 2020 9:55 pm
by straightlight
If the solution above doesn't solved the issue, try this one: viewtopic.php?f=190&t=165840&p=631012#p630942