Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1327665
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 4 years ago.
Improve this question;consumer_secret=abc
is working on when entered into the browser but fail with CURL with error:
{"code":"woocommerce_rest_cannot_view","message":"Sorry, you cannot list resources.","data":{"status":401}}
Closed. This question is off-topic. It is not currently accepting answers.
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 4 years ago.
Improve this questionhttps://www.example/wp-json/wc/v3/orders?consumer_key=123&consumer_secret=abc
is working on when entered into the browser but fail with CURL with error:
{"code":"woocommerce_rest_cannot_view","message":"Sorry, you cannot list resources.","data":{"status":401}}
Share
Improve this question
edited Jul 29, 2020 at 18:39
Tom J Nowell♦
61k7 gold badges79 silver badges148 bronze badges
asked Apr 4, 2020 at 21:59
Akan UdosenAkan Udosen
113 bronze badges
1 Answer
Reset to default 0I took a lot of time – the whole night – trying to fix this “401: Sorry, you cannot list resources.” The solutions shared by many online are great although they did not work as stated for me. In my case, running my own VPS server, what worked for me was going to WHM then under Service Configuration clicking Apache Configuration. In the “Include Editor:” in the “Pre Main Include”, I selected "All Versions" and pasted this from this link https://robotninja/blog/fix-common-woocommerce-rest-api-issues/
SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION=$1
On update it will ask to restart Apache. Restart and test your API – it should work. If you receive a 500 Internal Error, simply deactivate and reactivate woo-commerce plugin in the plugins section of WordPress.
Hope this helps someone and saves them hours of frustrations.
Edit... had to refer to this after i reset my configurations. In this line: SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION=$1 replace the double quotes and use the standard quotes because the above are pasted from Microsoft Word and are not the right kind of quote. Use this instead.
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
Hope this helps anyone who may stumble upon this issue
本文标签: What will make Woocommerce REST API to issue 401
版权声明:本文标题:What will make Woocommerce REST API to issue 401 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742223061a2435576.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论