Post by befungle » Tue Aug 01, 2017 3:25 am

OpenCart Version: 3.0.2.0
I've found a number of post regarding setting up API functionality with OpenCart, though most seem to refer to version 2.0+. The setup instructions indicate defining a user and key in the OpenCart Admin, then give illustrations of submitting these in the form of POST for API/Login.

I'm getting errors around a missing "API_TOKEN" value (which the code implies should be in the GET params). However, nothing in anything I've been able to find discusses this Token, and I've been unable to successfully reverse engineer the coding to any productive ends.

Beyond the API_TOKEN warning - I am also getting a SQL syntax error:

Fatal error: Uncaught exception 'Exception' with message 'Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`key` = '<REDACTED>' at line 1<br />Error No: 1064<br />SELECT * FROM `oc_api` WHERE `username` = '<REDACTED>' `key` = '<REDACTED>' AND status = '1'' in /Users/LLWebDev/Sites/OpenCart-3.0.2.0/upload/system/library/db/mysqli.php on line 40

Uncertain if I've simply missed a vital step or if there is something wrong with this newest version. Relatively new to OpenCart - veteran in other ways.

Newbie

Posts

Joined
Tue Aug 01, 2017 3:08 am

Post by straightlight » Sat Dec 02, 2017 3:48 am

According to this site: https://www.toadworld.com/platforms/ora ... ty-feature , it has nothing to do with a platform release. However, since this is unlikely a common issue reported on the forum, I would suggest to install a fresh copy of Opencart with a new database and see if this problem can be replicated. If so, contact your host to resolve this issue.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Storeship » Wed Apr 25, 2018 5:54 pm

I am also getting the same problem
Fatal error: Uncaught Exception: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`key`
<br />Error No: 1064<br />SELECT * FROM `api` WHERE `username` =

Newbie

Posts

Joined
Wed Sep 07, 2016 7:00 pm
Who is online

Users browsing this forum: belowcost and 367 guests