Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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.


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-12-28 19:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls