Page 1 of 1

Warning: Incorrect API Key!

Posted: Fri Jun 03, 2016 4:02 am
by harap
Hello Sirs,

How come I get two warnings on set/view order page in admin?
Warning: Your IP 99.58.13.123 is not allowed to access this API!
Warning: Incorrect API Key!

How to get IP to be allowed ?
I checked the only payment method Paypal account API is matched with my store settings. What API key is talking about here?

Please help. Thanks in advance!

Re: Warning: Incorrect API Key!

Posted: Fri Jun 03, 2016 3:36 pm
by imdevlper18
Hi,

In opencart 2.x new feature is added. Steps are as follows:

1) Create api user by going to admin - system - users - api.
2) Assign this api user to system - setting - edit - option - API User - save.

Once done. Make sure you don;t have maintenance mode or htaccess password protection system ON.

Now when you go to orders page. You only need to click ADD IP once. And now you can see / view / modify orders.

Re: Warning: Incorrect API Key!

Posted: Fri Jun 03, 2016 3:59 pm
by harap
Hello imdevlper18,

Thank you very much for detail advise. Yes, I got it.

Re: Warning: Incorrect API Key!

Posted: Fri Jun 10, 2016 12:59 am
by esk1mox
Created an API user
Assigned it under settigns-Option
website not under maintenance and no password in htaccess

YET I still see "Warning: Incorrect API Key!" when opening orders.

Beg for help! Thanks

Re: Warning: Incorrect API Key!

Posted: Sat Jun 11, 2016 1:22 pm
by imdevlper18
Hi,

You can contact us at support@cartbinder.com
We can help you with it.

Re: Warning: Incorrect API Key!

Posted: Mon Feb 04, 2019 4:39 am
by thekrotek
I will just leave it here in case anybody will be looking for solution. There's a very strange issue, which may pop on some server setups.

In catalog/model/account/api.php file find this line:

$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "api_ip` WHERE api_id = '" . (int)$api_id . "'");

And replace it with this:

$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "api_ip` WHERE api_id = " . (int)$api_id);

I have absolutely no idea, why removing single quotes in this particular case solves the issue, but it does. Hope it helps.