node-twilio icon indicating copy to clipboard operation
node-twilio copied to clipboard

undefined request params

Open ekosz opened this issue 14 years ago • 2 comments

I there I have this code

phone.on('incomingSms', function(smsParams, response) {
    console.log("REQUEST:");
    console.log(smsParams);
    var from = smsParams.From;
    ...
});

And when I get a response I see this in my logs

012-01-20T00:00:41+00:00 app[web.1]: REQUEST:
2012-01-20T00:00:41+00:00 app[web.1]: undefined
2012-01-20T00:00:41+00:00 app[web.1]: TypeError: Cannot read property 'From' of undefined

Am I doing something wrong? This seems like the exact way the docs do it.

Thank you!

ekosz avatar Jan 20 '12 00:01 ekosz

Forgot bodyParser() for express. I'm good now.

ekosz avatar Jan 20 '12 01:01 ekosz

Hmm, interesting. Can you post the rest of your code (initialization)?

Thanks, Stephen

On Thu, Jan 19, 2012 at 4:12 PM, Eric Koslow < [email protected]

wrote:

I there I have this code

phone.on('incomingSms', function(smsParams, response) {
   console.log("REQUEST:");
   console.log(smsParams);
   var from = smsParams.From;
   ...
});

And when I get a response I see this in my logs

012-01-20T00:00:41+00:00 app[web.1]: REQUEST:
2012-01-20T00:00:41+00:00 app[web.1]: undefined
2012-01-20T00:00:41+00:00 app[web.1]: TypeError: Cannot read property
'From' of undefined

Am I doing something wrong? This seems like the exact way the docs do it.

Thank you!


Reply to this email directly or view it on GitHub: https://github.com/sjwalter/node-twilio/issues/19

sjwalter avatar Jan 20 '12 17:01 sjwalter