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: Dec 5, 2018 1:52 AM
Views: 3
Tags: no tags
  1. const accountSid = process.env.TWILIO_ACCOUNT_SID;
  2. const authToken = process.env.TWILIO_AUTH_TOKEN;
  3. const client = require('twilio')(accountSid, authToken);
  4. // var localTime = new Date(Date.now()).toString();
  5.  
  6. // console.log(localTime);
  7.  
  8. client.messages
  9.   .create({
  10.  
  11.      mediaUrl:`https://${accountSid}:${authToken}@api.twilio.com/2010-04-01/Accounts/AC4da58e5f25ab72893b4696420b80d660/Recordings/RE0650ae26e26f34be786d0eaa0f245be1.mp3`,
  12.      body: 'Test MMS for Daniel',
  13.      from: '+19893092530',
  14.      to: '+13473272399'
  15.  
  16.    })
  17.   .then(message => console.log(message.sid))
  18.   .done();