Reputation: 123
Connecting to WooCommerce API, HTTP have no problems.
When I change the permalinks from http to https then try to connect using the https url I get:
{
"code": "woocommerce_rest_cannot_view",
"message": "Sorry, you cannot list resources.",
"data": {
"status": 401
}
}
I have an SSL cert, so I'm not sure why it won't work?
Please help,
Many thanks!
HTTPS
Upvotes: 2
Views: 4101
Reputation: 4284
According to WooCommerce REST API documentation:
Occasionally some servers may not parse the Authorization header correctly (if you see a “Consumer key is missing” error when authenticating over SSL, you have a server issue). In this case, you may provide the consumer key/secret as query string parameters instead.
Check that orders parameters are in the same order as examples, no space. Or I would use basic HTTPS authentication, that's how I comunicate using https:
https://localhost/wp-json/wc/v1/orders?consumer_key=ck_xxxxxxxxxxxxxx&consumer_secret=xxxxxxxxxxxxxxx
Upvotes: 3