0
Assistant Support

What to do if "Attention! API access denied!" ?

What to do if "Attention! API access denied!" ?

0 reviews
09.12.2020

Описание

An error called "Warning: Access to the API is denied!" It occurs very often, on different hostings and versions of Opencart. In fact, it does not greatly affect any functions in the CMS, but it is better to get rid of it, especially since this is done in literally 2 minutes.

Depending on the selected language in your CMS, when editing a product or order, you may receive the following errors:
  • Attention! Access to API is denied!
  • Invalid API key!
  • - Warning: You do not have permission to access the API!

How to solve this problem? There are 2 solutions, namely:

If you have a permanent IP address, then:
1. Go along the path - System -> Users -> API;
2. Create your own API, do not forget to include the status, and if it has already been created, then edit it by entering your IP address into the data;
3. Go to System -> Settings, select the desired store and go to its settings, go to the Options tab and in the API User field select the name of the API in which you entered your IP address.

If your IP is dynamic, or you want to completely hide this error:
1. Open the file via FTP at the path: /admin/controller/common/login.php
2. Find the code there:
 if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
And after it insert:
 $this->load->model('user/api');$api_info = $this->model_user_api->getApi($this->config->get('config_api_id'));
$this->model_user_api->addApiIp($api_info['api_id'], $this->request->server['REMOTE_ADDR']);
3. Update the modifiers, after which the error should disappear.
Автор: DEV-OPENCART.COM

%s reviews

Write a review

Пожалуйста, поставьте оценку:

Bookmarks

Cart (0)

Contacts

Technical support from 10:00 to 19:00, seven days a week

Web laboratory «DEV-OPENCART».
All rights reserved (c) 2018-2026