I am trying to: I am not specifically trying to use the Access plugin for anything here, but I am using it on a site where I now need to make use of the WooCommerce API. I believe this is a conflict.
Link to a page where the issue can be seen: N/A - this issue occurs when trying to use the API from elsewhere.
I expected to see: The WooCommerce API working as normal, at least while nothing has been set in Access to interfere with normal permissions related to products, orders, coupons etc.
Instead, I got: The WooCommerce API returns it's normal 401 related errors.
I have tested this on a brand new install of WordPress with minimal plugins installed so hopefully easy to replicate, here are the steps:
- Set up WordPress with Toolset Types, Access and WooCommerce installed and active
- Go to WooCommerce > Settings > Advanced > Rest API and set up new credentials
- Make a call from an external source, e.g. Postman, either of the following produces the same:
- GET hidden link
- Set authorisation to Basic Auth using Consumer Key as username and Consumer Secret as the password
- Instead of the product list you get:
{
"code": "woocommerce_rest_cannot_view",
"message": "Sorry, you cannot list resources.",
"data": {
"status": 401
}
}
Or:
- GET hidden link
- Instead of the product list you get:
{
"code": "woocommerce_rest_cannot_view",
"message": "Sorry, you cannot list resources.",
"data": {
"status": 401
}
}
Either of which should be fine according to WooCommerce:
- hidden link
If you deactivate the Access plugin and run either of the above it returns the product list
I did see this thread, but since it was 2 years old I thought I'd raise a new ticket:
- https://toolset.com/forums/topic/woocommerce-api-problem/
Thanks,