Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^3: Anyone Have Perl Code for New Amazon API?

by DanielSpaniel (Scribe)
on Oct 27, 2011 at 23:05 UTC ( #934267=note: print w/replies, xml ) Need Help??

in reply to Re^2: Anyone Have Perl Code for New Amazon API?
in thread Anyone Have Perl Code for New Amazon API? [SOLVED]

Solved. This was actually much easier than what I thought it was going to be ...

For anyone else that seeks Perl/Amazon API wisdom, for the new API, then a couple of things:

You can't just tack on the associates ID to the end of the request URL, because: firstly the params need to be in alphabetical order (yes, really ... so odd), but most importantly, it needs to be part of the request URL which gets "signed." That is, if you just tack it in the URL some place, without it being the portion of the URL which gets signed, then it won't work ... you'll get some signature error code back from Amazon.

So, if you have the example code from the previous API, then find the code in there which looks a bit like the code below, and simply insert the AssociateTag line in there. I think that's the only required new param, although there are several other changes to the API. The version line might need to be changed as well, although right now it works with the old version date.

my $request = { Service => 'AWSECommerceService', AssociateTag =>'xxxxxx', Operation => 'ItemSearch', BrowseNode=> $$node, Keywords =>"$$keywords", ItemPage =>"$$itempage", SearchIndex => $$searchindex, Version => '2009-03-31', ResponseGroup => $$response, };

Thanks to all who responded! Appreciated.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://934267]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2020-12-02 19:35 GMT
Find Nodes?
    Voting Booth?
    How often do you use taint mode?

    Results (45 votes). Check out past polls.