Question

I am trying to poll respondents that have changed answers or get new respondents but this code appears to pull in all of the data regardless. Have I got the wrong data key? The polling guide suggests adding start_modified_date but that doesn't work. Thanks in advance

var SurveyMonkeyAPI = require('surveymonkey').SurveyMonkeyAPI;

try { 
    var api = new SurveyMonkeyAPI(config.surveymonkey.key, config.surveymonkey.access_token, config.surveymonkey.params);
} catch (error) {
    console.log(error.message);
}

var data = {
    survey_id: surveyId,
    fields: ["date_created", "date_modified", "status"],
    start_modified_date: lastLoadedDate.toISOString().replace(/T/, ' ').replace(/\..+/, '')
};

console.log("FETCHING ", surveyId, data);
this.api.getRespondentList(data, this.bind(function (error, data) {
    if (error)
        console.log(error.message);
    else
        console.log(JSON.stringify(data)); // Do something with your data!
});
Était-ce utile?

La solution

Here is the fork that has it fixed https://github.com/GeorgePhillips/node-surveymonkey

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top