I am trying to make a couple requests on the same page using the Amazon Product Affiliate API. I am using apac and Meteor. Basically, when I try to run the two searches asynchronously, I get an error that says:
SignatureDoesNotMatch - "The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details."
My code is below:
var type = 'ItemSearch';
var options = {
'SearchIndex': 'Appliances',
'Availability': 'Available',
'Keywords': 'blender',
'ResponseGroup': 'ItemAttributes, OfferFull'
}
var opHelper = new OperationHelper({
awsId: process.env.AWS_ACCESS_ID,
awsSecret: process.env.AWS_SECRET_ID,
assocId: process.env.AWS_ASSOCIATE_TAG
});
var opExecuteSynchronous = Meteor.wrapAsync(opHelper.execute, opHelper);
var results = opExecuteSynchronous(type, options);
options['Keywords'] = 'fridge';
var results = opExecuteSynchronous(type, options);
When I run only one of the options, I get a perfectly fine response. Any tips on how I can fix this while still being able to use Meteor.wrapAsync?
Aucun commentaire:
Enregistrer un commentaire