woocommerce / wc-api-ruby

A Ruby wrapper for the WooCommerce API.
MIT License
69 stars 74 forks source link

404 on authentication #25

Closed jessicams91 closed 8 years ago

jessicams91 commented 8 years ago

I was using legacy v2, but on a recent update to woocommerce 2.6.1 I can't connect to the API.

this was the configuration before:

  woocommerce = WooCommerce::API.new(
  self.url, #Url do site
  self.consumer_key, #Consumer Key
  self.consumer_secret, #Consumer Secret
    {
      version: "v2" #Versão da API
    }
  )

now:

  woocommerce = WooCommerce::API.new(
  self.url, #Url do site
  self.consumer_key, #Consumer Key
  self.consumer_secret, #Consumer Secret
    {
      wp_api: true,
      version: "wc/v1"
    }
  )

but I get this:

JSON::ParserError: 795: unexpected token at '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

404 Not Found

Not Found

The requested URL /wp-json/wc/v1/ was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I tried to access the url but get a 404 too, I didn't find any similar issue, any idea what could it be? My permalinks is custom and default for products. I also tried using wp_json as stated on the documentation, but same results

claudiosanches commented 8 years ago

@jessicams91 what WordPress version?

jessicams91 commented 8 years ago

4.4.3 and my permalink is set to /index.php/%year%/%monthnum%/%day%/%postname%/

claudiosanches commented 8 years ago

Can you access http://yoursite.com/wp-json/ ?

jessicams91 commented 8 years ago

nope, 404, can it be because of the /index.php?

claudiosanches commented 8 years ago

Maybe, you need to fix your installation. It's a problem with the WP REST API in your site and not with this wrapper or the WooCommerce REST API.

jessicams91 commented 8 years ago

Ok, I'll try the WordPress REST API plugin to see if it works