lundi 2 mars 2015

Node-apac output: how to get items returned


Vote count:

0




How to get the list of items from node-apac ? I am trying the quick start example as following:



var util = require('util'),
OperationHelper = require('apac').OperationHelper;

var opHelper = new OperationHelper({
awsId: '[YOUR AWS ID HERE]',
awsSecret: '[YOUR AWS SECRET HERE]',
assocId: '[YOUR ASSOCIATE TAG HERE]'
// xml2jsOptions: an extra, optional, parameter for if you want to pass additional options for the xml2js module. (see http://ift.tt/1BzmU6Z)
});


// execute(operation, params, callback)
// operation: select from http://ift.tt/1AOX4tu
// params: parameters for operation (optional)
// callback(err, parsed, raw): callback function handling results. err = potential errors raised from xml2js.parseString() or http.request(). parsed = xml2js parsed response. raw = raw xml response.

opHelper.execute('ItemSearch', {
'SearchIndex': 'Books',
'Keywords': 'harry potter',
'ResponseGroup': 'ItemAttributes,Offers'
}, function(err, results) { // you can add a third parameter for the raw xml response, "results" here are currently parsed using xml2js
console.log(results);
});

// output:
// { ItemSearchResponse:
// { '$': { xmlns: 'http://ift.tt/JgRJni' },
// OperationRequest: [ [Object] ],
// Items: [ [Object] ] } }


I got the same output as the output above. It seems to me that the output is empty. I have changed the 'Keywords': value but the output is still the same. Where to modify to get the list of items returned. Or should I change the endpoint? Where? I am new to node.js and Amazon product api. Thank you.



asked 1 min ago







Node-apac output: how to get items returned

Aucun commentaire:

Enregistrer un commentaire