"error_message": "Sorry, you cannot list resources." using WooCommerce API

When requesting the test API, getting the following response:

{
    "errors": [
        {
            "error_code": "",
            "error_message": "Sorry, you cannot list resources."
        }
    ]
}

The credentials are OK, REST API keys have both read/write permissions. I tried with newly generated API keys, same problem.

Topic woocommerce-offtopic rest-api Wordpress

Category Web


Here ya go

The original .htaccess looked like this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Then I changed it to the following

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteBase /
RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

and now it works !!!

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.