Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var accountSid = 'AAAAAAA';
- var authToken = 'AAAAAAA';
- var notifyServiceSid = 'AAAAAAA'
- var twilio = require('twilio');
- var client = new twilio(accountSid, authToken);
- var listBindings = function () {
- client.notify.services(notifyServiceSid)
- .bindings
- .each(
- bindings => console.log(bindings.sid + " :: " + bindings.address)
- );
- }
- var deleteBinding = function (binding) {
- client.notify.services(notifyServiceSid)
- .bindings(binding)
- .remove()
- .then(binding => console.log(binding.sid))
- .done();
- }
- var createBinding = function (number) {
- client.notify.services(notifyServiceSid)
- .bindings
- .create({
- tag: 'api',
- identity: number,
- bindingType: 'sms',
- address: number
- })
- .then(binding => console.log(binding.sid))
- .done();
- }
- listBindings();
Add Comment
Please, Sign In to add comment