Mohib Salahuddin Ayubi
Mohib Salahuddin Ayubi

Reputation: 199

401 Error on rest apis on default woocommerce API requests

Their is a strange 401 error comes in basic rest APIs. For example:

https://parosi.techchef.org/wp-json/wc/v3/products/categories?consumer_key=ck_f76c28eae983eb9b237d6bb81dd5b6c1ee35d16f

I have already checked and trouble shoot following steps.

1- Enable the legacy REST API is checked
2- I have made new rest api and applied the same consumer key
3- I created new admin and tried
4- I replace htaccess with default wordpress
5- I have upgrade both wordpress and woocommerce version to latest
6- I have disabled all other plugins

But none of the things work still, rest every thing is working fine but rest-API authentication for woocommerce does not

Upvotes: 1

Views: 6628

Answers (1)

Mohib Salahuddin Ayubi
Mohib Salahuddin Ayubi

Reputation: 199

I got the solution below, posted here: WooCommerce - woocommerce_rest_cannot_view - Status 401

The 401 error you are getting is because you are using basic auth even though your website is not secure (does not have https).

The solution in postman is to use OAuth 1.0. Just add the consumer key and consumer secret and send the request.

Upvotes: 6

Related Questions