A simple twilio sms client for Node.js
Content-Type: application/json
{
"recipient" : "+61xxxxxxxxx",
"message": "Hello, this is a message sent to one person!"
}
Content-Type: application/json
{
"recipient" : "+61xxxxxxxxx",
"message": "Hello, this is a message sent to one person!"
}
Content-Type: application/json
{
"recipients" : ["+61xxxxxxxx1","+61xxxxxxxx2","+61xxxxxxxx3","+61xxxxxxxx4","+61xxxxxxxx5"],
"message": "Hello, this is a group message"
}
Use this endpoint as a webhook
and configure in: https://www.twilio.com/console/phone-numbers/incoming
- Choose a number
- Under Messaging, select Configure with Webhooks, TwiML Bins, Functions, Studio or Proxy
- Specify the public url in "A mesage comes in" text box. Select HTTP POST
Example console.log output:
{ ToCountry: 'AU',
ToState: '',
SmsMessageSid: 'SMdb07337513b4f2d7933eda58eaffd0d6',
NumMedia: '0',
ToCity: '',
FromZip: '',
SmsSid: 'SMdb07337513b4f2d7933eda58eaffd0d6',
FromState: '',
SmsStatus: 'received',
FromCity: '',
Body: 'Hi John',
FromCountry: 'AU',
To: '+61448032193',
ToZip: '',
NumSegments: '1',
MessageSid: 'SMdb07337513b4f2d7933eda58eaffd0d6',
AccountSid: 'AC22458b497113eec0a935a684af68ab28',
From: '+61439204670',
ApiVersion: '2010-04-01' }