Question

I'm starting to get my head around the BigCommerce gem 0.9.0 (https://github.com/bigcommerce/bigcommerce-api-ruby) and am having troubles with the Brands resource. I'm not experienced enough to know whether I'm doing something wrong (highly likely) or if it's a bug (not so likely).

After setting up a connection on 'api', from IRB; I can call;

api.create_brands({:name => "testcategory"})

which succeeds. I can also do brands(x number) which works.

If I try to call;

api.brands_count

which based on https://github.com/bigcommerce/bigcommerce-api-ruby/blob/master/lib/bigcommerce/api.rb gives the brands_count method as;

def brands_count
  @connection.get '/brands/count'
end

I get undefined method 'brands_count'.

Same error with just straight 'brands';

api.brands({:min_id=>1,:max_id=>101}) 

and even the basic 'time' end point gives the error and I can't figure out why some things are working but others aren't.

Can anyone point out what I'm doing wrong please?

Was it helpful?

Solution

Had this issue with multiple endpoints; I ended up moving to using HTTParty directly.

I suspect I probably didn't check for JSON bodies or the correct headers; as I had to deal with these in HTTParty also.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top