Skip to content

Instantly share code, notes, and snippets.

@tfogo
Last active January 23, 2017 20:54
Show Gist options
  • Select an option

  • Save tfogo/97873b3b5b08c50ece0c605095ff5dbb to your computer and use it in GitHub Desktop.

Select an option

Save tfogo/97873b3b5b08c50ece0c605095ff5dbb to your computer and use it in GitHub Desktop.
Make a call to the available phone numbers Twilio API
var twilio = require('twilio');
const accountSid = process.env.TWILIO_AC_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
var client = require('twilio')(accountSid, authToken);
// Make a call to the available phone numbers API for the US
var twilioPromise = client.availablePhoneNumbers('US').local.list({
areaCode: '650'
});
twilioPromise.then(data => {
console.log(data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment