PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, February 12, 2022

[FIXED] 401 Error on rest apis on default woocommerce API requests

 February 12, 2022     woocommerce, wordpress     No comments   

Issue

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


Solution

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.


Answered By - Mohib Salahuddin Ayubi
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing