Even after setting up the REST API WooCommerce, you still get the following when performing an authenticated request:
{"code":"woocommerce_rest_cannot_view","message":"Sorry, you cannot list resources.","data":{"status":401}}
Even after setting up the REST API WooCommerce, you still get the following when performing an authenticated request:
{"code":"woocommerce_rest_cannot_view","message":"Sorry, you cannot list resources.","data":{"status":401}}
2
Answers
The Authorization header is not being passed to PHP. Add the following to your .htaccess file at the top.
Needed for WooCommerce API
RewriteRule ^index.php$ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
Try with below method
The key is query_string_auth: true you need to force basic authentication as query string true under HTTPS