Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Love Code
Added: Jun 9, 2018 10:32 PM
Views: 19
Tags: no tags
Twilio confirm delivery node.js
  1. // Download the helper library from https://www.twilio.com/docs/node/install
  2. // Your Account Sid and Auth Token from twilio.com/console
  3. const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
  4. const authToken = 'your_auth_token';
  5. const client = require('twilio')(accountSid, authToken);
  6.  
  7. client.messages
  8.       .create({
  9.          body: 'McAvoy or Stewart? These timelines can get so confusing.',
  10.          from: '+15017122661',
  11.          statusCallback: 'http://requestb.in/1234abcd',
  12.          to: '+15558675310'
  13.        })
  14.       .then(message => console.log(message.sid))
  15.       .done();