lionheart / bottlenose

A Python wrapper for the Amazon Product Advertising API.
Apache License 2.0
577 stars 112 forks source link

Why is AssociateTag a required parameter? #8

Closed klonuo closed 13 years ago

klonuo commented 13 years ago

?

dlo commented 13 years ago

Can you explain the issue?

klonuo commented 13 years ago

Sure. I thought it's obvious

I was using:

amazon = bottlenose.Amazon(AWS_KEY, SECRET_KEY)

I PIP installed bottlenose (new version)

Script now complains about "AssociateTag" missing, and example in your readme file seems to have it included

Before it wasn't needed.

I removed new version and installed 2.1 - works as expected

On Sun, Sep 4, 2011 at 6:49 AM, dlo reply@reply.github.com wrote:

Can you explain the issue?

Reply to this email directly or view it on GitHub: https://github.com/dlo/bottlenose/issues/8#issuecomment-1989951

dlo commented 13 years ago

That's bizarre...I haven't touched that in the code. What line in the script was an exception raised? AFAIK the script checks to see that AssociateTag is available, and if it isn't, it just skips it.

Maybe this is an Amazon-based change...can you confirm?

klonuo commented 13 years ago

here is snippet:

    amazon = bottlenose.Amazon(AWS_KEY, SECRET_KEY)
    response = amazon.ItemLookup(
        ItemId = isbn,
        IdType = 'ISBN',
        SearchIndex = 'Books',
        ResponseGroup = 'ItemAttributes, EditorialReview, Images')

response says AssociateTag is missing, and does not provide data I requested.

I quickly search what this AssociateTag maight be, but got bored by Amazon help system, and downgraded bottlenose to 2.1 version which worked fine.

dlo commented 13 years ago

Ah, I figured out why. It has nothing to do with the Bottlenose version--it has to do with the version of Amazon's API you're using. The latest version of Bottlenose pushed the default version to 2011-08-01 (the latest). Bottlenose v2.1 has the Amazon API version set to 2009-10-01. This is pretty old.

Note that you can specify the version in the initialization parameters like so:

amazon = bottlenose.Amazon(AWS_KEY, SECRET_KEY, Version="2009-10-01")
klonuo commented 13 years ago

I removed old version and installed new again.

Using:

amazon = bottlenose.Amazon(AWS_KEY, SECRET_KEY, Version="2009-10-01")

I get: InvalidParameterValue for ISBN value in above snippet

So it seems that it can't work this way, without additional changes probably

I also thought that maybe changing xml namespace to current date was problem, as that just happend some months ago (when I pip installed bottlenose on another PC) - I changed 2009-10-01 to 2010-11-01, which fixed problem back then, but I don't remember what was the initial error. Unforunatelly to me it has nothing to do with xml namespace. Above snippet is part of script which is part of script... I don't track Amazon API changes and that's why in the first place I use your module (Thanks BTW)

So can you be so kind, and reply why it asks this parameter? Can I somehow use your module with my script without it? I could go back to 2.1 again, but I guess it wont work forever, and I already opened this topic

Thanks

On Sun, Sep 4, 2011 at 10:41 PM, dlo reply@reply.github.com wrote:

Ah, I figured out why. It has nothing to do with the Bottlenose version--it has to do with the version of Amazon's API you're using. The latest version of Bottlenose pushed the default version to 2011-08-01 (the latest). Bottlenose v2.1 has the Amazon API version set to 2009-10-01. This is pretty old.

Note that you can specify the version in the initialization parameters like so:

   amazon = bottlenose.Amazon(AWS_KEY, SECRET_KEY, Version="2009-10-01")

Reply to this email directly or view it on GitHub: https://github.com/dlo/bottlenose/issues/8#issuecomment-1993740

dlo commented 13 years ago

What do you mean by InvalidParameterValue? What was the request you made?

Also, in general, if you receive any errors, it's most likely because Amazon rejected the request.

klonuo commented 13 years ago

It's same request as in the snippet I posted earlier. It did not recognize ISBN as IdType.

I installed 2.1 again

On Mon, Sep 5, 2011 at 2:16 AM, dlo reply@reply.github.com wrote:

What do you mean by InvalidParameterValue? What was the request you made?

Also, in general, f you receive any errors, it's most likely because Amazon rejected the request.

Reply to this email directly or view it on GitHub: https://github.com/dlo/bottlenose/issues/8#issuecomment-1994635

Nesquik commented 13 years ago

I can't reproduce your issue. I used the very code you posted before and i got the proper xml response:

amazon = bottlenose.Amazon(AWS_KEY, SECRET_KEY, Version="2009-10-01")
response = amazon.ItemLookup(
    ItemId = '0137903952',
    IdType = 'ISBN',
    SearchIndex = 'Books',
    ResponseGroup = 'ItemAttributes, EditorialReview, Images')

I'm using Python 2.5.4 and bottlenose 0.3.4.

klonuo commented 13 years ago

Thanks for your reply. It could be fault at my end, then I'm on 2.1 currently, and it works without issue for me I'll look closer at this, these days

Cheers

On Mon, Sep 5, 2011 at 4:32 PM, Nesquik reply@reply.github.com wrote:

I can't reproduce your issue. I used the very code you posted before and i got the proper xml response:

   amazon = bottlenose.Amazon(AWS_KEY, SECRET_KEY, Version="2009-10-01")    response = amazon.ItemLookup(        ItemId = '0137903952',        IdType = 'ISBN',        SearchIndex = 'Books',        ResponseGroup = 'ItemAttributes, EditorialReview, Images')

I'm using Python 2.5.4 and bottlenose 0.3.4.

Reply to this email directly or view it on GitHub: https://github.com/dlo/bottlenose/issues/8#issuecomment-2001029

danielmagnussons commented 12 years ago

https://forums.aws.amazon.com/message.jspa?messageID=286505

Seems like this tag is needed, below worked for me

import bottlenose amazon = bottlenose.Amazon(AWS_KEY, SECRET_KEY, Version="2009-10-01") response = amazon.ItemLookup( ItemId = '0137903952', IdType = 'ISBN', SearchIndex = 'Books', AssociateTag = 'your_tag_here', ResponseGroup = 'ItemAttributes, EditorialReview, Images')

facundofarias commented 11 years ago

Its works also if you put any string on the field :)