Page 4 of 4

Re: Warning: You do not have permission to access the API! OC2

Posted: Sun Dec 16, 2018 1:45 am
by xxvirusxx

Re: Warning: You do not have permission to access the API! OC2

Posted: Fri Jan 04, 2019 8:51 am
by insurenow
Go to System > Setting > Edit Your main Store > Click on Option
See here : API User
Select Your API USER

And thats it Solved

Re: Warning: You do not have permission to access the API! OC2

Posted: Sun Jan 13, 2019 3:51 am
by OSWorX
3.0.2.0 is different in handling the IPs and API that is why it is working.
In 2.x simply hit the button to add the IP.

Re: Warning: You do not have permission to access the API! OC2

Posted: Thu Mar 28, 2019 8:17 pm
by thekrotek
Just to sum this up...

Why the API issue happens?
Because since OC 2 OpenCart has absolutely ugly algorithm of editing orders from admin. In my opinion, it doesn't have any excuses or really solid reasons to be implemented. Never seen anything like this in any other platform and hopefully never will.

When it happens?
Sometimes it is indeed an issue with API settings or database structure after OC upgrade, sometimes a server side issue.

How can I fix this?
There're plenty simple solutions right in this topic, which may help, if your case is wrong setup/upgrade. If none of them helped and you're pretty sure, that all settings are correct, then you're, well... fudged. Even if you disable API check, the issue may stay and pop again in different places. For example, when editing an order, a payment/shipping address may be stored in session and not retrieved right in the next API call, when payment/shipping methods are queried. This happens, because session data was lost.

I've seen it personally on a few systems and there was a discussion of StackOverflow a few years ago, where issues with particular version of CentOS (or maybe some other server OS, not sure) were reported. The only way in the case, when no other solution helped, is to get yourself an admin and start digging into the issue.

P.S.: For me this API issue ALWAYS happened on OC 2.3 only, other versions worked just fine. It appears, that OC 2.3 is the most troublesome version, when it comes to API.

Re: Warning: You do not have permission to access the API! OC2

Posted: Fri Mar 29, 2019 4:35 am
by straightlight
P.S.: For me this API issue ALWAYS happened on OC 2.3 only, other versions worked just fine. It appears, that OC 2.3 is the most troublesome version, when it comes to API.
Correct. v3.x releases have been mostly fixed regarding the APIs since.

Re: Warning: You do not have permission to access the API! OC2

Posted: Sun Oct 06, 2019 3:49 am
by kur1977@gmail.com
catalog\controller\startup\session.php

just add string: $this->session->data['api_id'] = $query->row['api_id'];
after the string $this->session->start('api', $query->row['session_id']);

Re: Warning: You do not have permission to access the API! OC2

Posted: Sat Aug 19, 2023 1:15 am
by Live_Life
I am cross posting this since it is not on this thread and this thread pops up first when you search "You do not have permission to access the API!" hopefully it will save other people time.
CódigoNET wrote:
Tue Aug 03, 2021 12:20 pm
Try

UPDATE `oc_setting` SET `value` = 'UTC' WHERE `key` = 'config_timezone';
This worked for me after trying all sorts of other solutions so Thank You CódigoNET.

Just a slight addition for other people: UPDATE `ocxx_setting` SET `value` = 'UTC' WHERE `key` = 'config_timezone';
where xx in ocxx_setting will vary depending on your database.

The GitHub issue for the timezone affecting the API is here, if anyone is interested. https://github.com/opencart/opencart/issues/9492

Re: Warning: You do not have permission to access the API! OC2

Posted: Mon Jan 29, 2024 5:42 pm
by Rdilendra
i want API_token to practicing opencart API,becouse by using postman test command i failed to get API_token. so kindly please provide me API_key

Re: Warning: You do not have permission to access the API! OC2

Posted: Mon Jan 29, 2024 10:13 pm
by Cue4cheap
Rdilendra wrote:
Mon Jan 29, 2024 5:42 pm
i want API_token to practicing opencart API,becouse by using postman test command i failed to get API_token. so kindly please provide me API_key
Huh?
Tell us what testing you are trying to do in postman otherwise we would just have to guess what you are trying to do.

Mike

Re: Warning: You do not have permission to access the API! OC2

Posted: Tue Jan 30, 2024 6:07 am
by straightlight
Rdilendra wrote:
Mon Jan 29, 2024 5:42 pm
i want API_token to practicing opencart API,becouse by using postman test command i failed to get API_token. so kindly please provide me API_key
OC version. Contact your postman sales support by email or by phone. They will provide you one.