Home > Mobile >  Cannot access woocommerce rest api in wordpress 5.8.1
Cannot access woocommerce rest api in wordpress 5.8.1

Time:10-23

I run woocommerce from docker image 5.8.1-apache with mysql 5.7 (via docker-compose)

After I have Generated API keys in woocommerce as stated in the guidelines, I try to access the url http://localhost:8180/wp-json/wc/v3/products (I expose 80 to 8180 on host) but I get a page saying:

Not Found The requested URL was not found on this server.

Apache/2.4.51 (Debian) Server at localhost Port 8180

The same guidelines also say that I have to enable permalinks:

WordPress permalinks must be enabled at: Settings > Permalinks.

But when I go to Settings->Permalinks section I don't see any checkbox or option saying "enable permalinks".

What am I missing?

CodePudding user response:

So in order to actually be able to use the WC REST API -as the guide says- you need to make sure that you're using "pretty permalinks" (a.k.a. not the "Plain one").

Go to Settings > Permalinks, then pick any of the permalink options (eg. Post name), then save changes.

  • Related