There are a few posts on something similar, however I feel mine is unique.
So below I have included some screenshots for proof. I have followed the documentation and have restarted a few times now. Each time I restarted, I had been solving issues after issues. So lets start by what I have done
- Installed woocommerece
- Moved local development to https://carteapp.net ( my website ) for SSL certification for Basic authorization requested in the documentation
- Created both consumer key and secret key done in woocommerce settings
- used consumer and secret key in the body of postman
- Disabled any plugin that could potentially affect the api ( json api, json auth, My own custom plugins, user related plugns, etc)
- I bought a theme, so I did change the theme to the default one that it came with.
but my errors remain the same.
{
"code": "woocommerce_rest_cannot_view",
"message": "Sorry, you cannot list resources.",
"data": {
"status": 401
}
}
Here are some images for your reference
https://imgur.com/a/DQHvfe5
the consumer and secret key in the images no longer work. As I have cleaned and installed many fresh WordPress now. If anybody had similar issue and found a solution to this. Please share them.
Websites that I had looked into
https://sgwebpartners.com/how-to-use-woocommerce-api/
https://help.robotninja.com/en/articles/2015407-woocommerce-api-authentication-issues
https://woocommerce.github.io/woocommerce-rest-api-docs/#rest-api-keys
and many more, but those did not suggest any type of solution besides the usual, you have done something wrong and did not follow the documentation.
2
Answers
I solved this a while back.
The solution was that apparently not all of the pages were secured with SSL
Thus I installed an add-on to make everything secure with SSL. Then it worked.
Make sure that you are providing correct API url and Authorization you can use any of(basic auth or 0auth1.0).
[check screenshot]
https://i.stack.imgur.com/Q2IlM.png