mercredi 14 janvier 2015

Calling Amazon API from iOS app is failing

I'm attempting to make an Amazon API call like so:



console.log('about to define AmazonHttpRequestPromise');

var AmazonHttpRequestPromise = Parse.Cloud.httpRequest({
url: url,
params: {
'AWSAccessKeyId': '*ACCESS KEY GOES HERE*',
'AssociateTag': '*ASSOCIATE TAG GOES HERE*',
'Keywords': 'harry+potter',
'Operation': 'ItemSearch',
'SearchIndex': 'Books',
'Service': 'AWSECommerceService',
'Version': '2013-08-01',
}
});

console.log('AmazonHttpRequestPromise looks like this:' + AmazonHttpRequestPromise);

return AmazonHttpRequestPromise;


I've set up the error message to work like this:



function (err) {
console.log('error!' + err);
response.error('DAMN IT MAN');
}


and as a result, the error message it returns is this:



error![object Object],[object Object]


am I setting up the call incorrectly? I can't figure out where I'm going wrong.





Aucun commentaire:

Enregistrer un commentaire