Too many request with just one request

Highlighted
New Member
3 0 0

I am getting a 429 "Too Many Requests" error when just saving one new product.  I am able to call other API requests just fine.  For example, I create a session, lookup a product using ShopifyAPI::Product.find(xxxx) and the product comes back just fine.  If I use ShopifyAPI::Product.new and fill in the product and call .save on that object I get the 429 error.  This doesn't seem correct.  I could understand if there was another error, but 429 can't be correct.

 

irb(main):225:0* Shop.find(4).connect
=> #<SourceConnection:0x0000000d5d1058 @source_class=Shopify(abstract), @shop_id=4, @domain="*****", @token="****", @call_limit=10>
irb(main):226:0> ShopifyAPI::Product.find(*****)
=> #<ShopifyAPI::Product:0x0000000d**** @attributes={"id"=>*****, "title"=>"1-800-****", "body_html"=>"", "vendor"=>"****", "product_type"=>"Raglan", "created_at"=>"2018-10-25T13:53:04-04:00" ...


irb(main):230:0> obj.save
ActiveResource::ClientError: Failed.  Response code = 429.  Response message = Too Many Requests.
        from (irb):230
0 Likes
Shopify Staff
Shopify Staff
299 32 59

Hey Jay,

 

It sounds like you might be running into a resource-based API call limit as described here.

 

If you provide me with the Request Id header found in the response, I can then confirm if this is actually the case.

 

If it is, you will have to implement an exponential backoff algorithm to complete the call at a later time.

0 Likes
New Member
3 0 0

How do I get the response body from the API request through the Ruby shopify_api gem?

0 Likes
New Member
3 0 0

When this error gets thrown it doesn't set the ShopifyAPI::Base.connection.response object.  It is still the same from the last call.  So I am not sure how to access the response.

0 Likes