How to use the twilio.PricingClient function in twilio

To help you get started, we’ve selected a few twilio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TwilioDevEd / api-snippets / pricing / get-messaging-country / get-messaging-country.2.x.js View on Github external
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
var authToken = "your_auth_token";
var PricingClient = require('twilio').PricingClient;
var client = new PricingClient(accountSid, authToken);

client.messaging.countries('EE').get(function(err, country) {
    var cpList = country.inboundSmsPrices;
    for (var i = 0; i < cpList.length; i++) {
        console.log(cpList[i].numberType + " " + cpList[i].currentPrice + "\n");
    }
});
github TwilioDevEd / api-snippets / pricing / get-phone-number-country / get-phone-number-country.2.x.js View on Github external
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var PricingClient = require('twilio').PricingClient;
var client = new PricingClient(accountSid, authToken);

client.phoneNumbers.countries("US").get(function(err, country) {
	country.phoneNumberPrices.forEach(function(phonePrices){
        console.log(phonePrices.numberType + " " + phonePrices.currentPrice + "\n");
	}); 
});
github TwilioDevEd / api-snippets / pricing / list-voice-countries / list-voice-countries.2.x.js View on Github external
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var PricingClient = require('twilio').PricingClient;
var client = new PricingClient(accountSid, authToken);

client.voice.countries.list(function(error, response) {
    var cList = response.countries;
    for (var i = 0; i < cList.length; i++) {
        console.log(cList[i].isoCountry + "\n");
    }
});
github TwilioDevEd / api-snippets / pricing / get-voice-country / get-voice-country.2.x.js View on Github external
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var PricingClient = require('twilio').PricingClient;
var client = new PricingClient(accountSid, authToken);

client.voice.countries('EE').get(function(err, country) {
    var cpList = country.inboundCallPrices;
    for (var i = 0; i < cpList.length; i++) {
        console.log(cpList[i].numberType + " " + cpList[i].currentPrice + "\n");
    }
});
github TwilioDevEd / api-snippets / pricing / list-phone-number-countries / list-phone-number-countries.2.x.js View on Github external
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var PricingClient = require('twilio').PricingClient;
var client = new PricingClient(accountSid, authToken);

client.phoneNumbers.countries.list(function(error, countries) {
    countries['countries'].forEach(function(c){
        console.log(c.isoCountry + "\n");
    });
});
github TwilioDevEd / api-snippets / pricing / list-messaging-countries / list-messaging-countries.2.x.js View on Github external
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
var authToken = "your_auth_token";
var PricingClient = require('twilio').PricingClient;
var client = new PricingClient(accountSid, authToken);

client.messaging.countries.list(function(error, response) {
    var cList = response.countries;
    for (var i = 0; i < cList.length; i++) {
        console.log(cList[i].isoCountry + "\n");
    }
});
github TwilioDevEd / api-snippets / pricing / get-voice-number / get-voice-number.2.x.js View on Github external
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var PricingClient = require('twilio').PricingClient;
var client = new PricingClient(accountSid, authToken);

client.voice.numbers("+15108675309").get(function(err, number) {
    console.log(number.outboundCallPrice.currentPrice);
});