Closed jmalley closed 9 years ago
Can you paste some sample code for me to look at? Thanks!
In my model:
def self.amazon_item_lookup(item_id)
product_id = item_id.to_i
client = A2z::Client.new(key: ENV["AMZN_KEY_ID"], secret: ENV["AMZN_SECRET"], tag: ENV["AMZN_TAG"])
response = client.item_lookup do
id product_id
response_group('Large')
end
return response
end
In my controller:
@amazon_item_search = Gift.amazon_item_lookup(@gift.link_code)
Thank you!
I figured out my issue. Was passing item ID (ASIN) as an integer instead of a string. My bad!
Ahh awesome, sorry for not getting back to you quicker! Glad you were able to figure it out. :)
I believe I have set it up correctly. I am getting a response that has an 'item' method in it, but the item is always nil when I do a product lookup. I have tried multiple product IDs, and different response groups.
The object I'm interacting with is A2z::Responses::ItemLookup. Is that correct?
Thanks.