Pricing: Messaging Resource

The Pricing Messaging resource provides a simple API to pull real-time, account-specific pricing for Twilio's SMS product.

Prices can be retrieved at a country level directly via the Pricing Messaging Countries resource or for a specific phone number by leveraging the Lookup API and Pricing Messaging Countries resource.

You may also wish to check out our Pricing API resources for Twilio's Voice and Phone Number products.

Looking for details on pricing for Twilio products? Check out Twilio's pricing page.

ベースURL

リファレンスドキュメントの URL はすべて、次のベース URL を使用しています。

https://pricing.twilio.com/v1

認証

REST APIへのHTTPリクエストはHTTPのBasic認証により保護されます。Twilioが認証を処理する方法を確認するには、セキュリティードキュメントを参照してください。つまり、HTTPのBasic認証にはアカウントSIDをユーザー名として、そして認証トークンをパスワードとして使用するということです。

curl -G https://pricing.twilio.com/v1/Messaging/Countries/US \
    -u '[YOUR ACCOUNT SID]:[YOUR AUTH TOKEN]'

You can find your account SID and auth token on your dashboard.

Pricing Messaging Country Instance Resource

このリソースは、モバイル国コード(MCC)とモバイルネットワークコード(MNC)で編成した特定の国の電話番号に SMS メッセージを送信する料金および電話番号タイプで編成したその国で Twilio 電話番号に送信されたメッセージを受信する料金を表します。

リソース URL

https://pricing.twilio.com/v1/Messaging/Countries/{Country}

{Country} は、ISO 3166-1 alpha-2 フォーマットの国コードです。

リソースのプロパティ

Pricing Messaging Country リソースには、次のプロパティがあります。

名前 概要

Name of the country (not PII)

inbound_sms_prices

List of InboundPrice records that represent the prices to receive an inbound SMS to different Twilio phone number types supported in this country (not PII)

iso_country

The ISO country code (not PII)

outbound_sms_prices

List of OutboundSMSPrice records that represent the price to send a message for each MCC/MNC applicable in this country (not PII)

price_unit

The currency in which prices are measured, in ISO 4127 format (e.g. usd, eur, jpy). (not PII)

OutboundSmsPrice record

プロパティ 概要
MCC モバイル国コードです。
MNC モバイルネットワークコードです。
キャリアー この MCC/MNC の組み合わせのキャリアの名前です。
Prices 個々の Twilio 電話番号タイプからこの MCC/MNC に SMS を送信する料金を表す OutboundPrice レコードのリストです。

OutboundPrice record

プロパティ 概要
NumberType メッセージを送信する Twilio 電話番号のタイプです(mobilelocalshortcode、または toll free のいずれか)。
BasePrice メッセージを送信する小売料金です。
CurrentPrice メッセージを送信する現在の料金(数量割引またはカスタム割引の適用対象)です。

InboundPrice record

プロパティ 概要
NumberType メッセージを受信する Twilio 電話番号のタイプです(mobilelocalshortcode、または toll free のいずれか)。
BasePrice メッセージを受信する小売料金です。
CurrentPrice メッセージを受信する現在の料金(数量割引またはカスタム割引の適用対象)です。

コードサンプルを読み込んでいます...
Language
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const PricingClient = require('twilio').PricingClient;
const client = new PricingClient(accountSid, authToken);

client.messaging.countries('EE').get((err, country) => {
  const cpList = country.inboundSmsPrices;
  for (let i = 0; i < cpList.length; i++) {
    console.log(cpList[i].numberType + ' ' + cpList[i].currentPrice + '\n');
  }
});
// Get your Account SID and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

// Get twilio-node from twilio.com/docs/libraries/node
const client = require('twilio')(accountSid, authToken).pricing;

client.messaging
  .countries('EE')
  .fetch()
  .then(country => {
    country.inboundSmsPrices.forEach(price => {
      console.log(`${price.number_type} ${price.current_price}`);
    });
  })
  .catch(error => {
    console.log(error);
    throw error;
  });
// The C# helper library 5.x will support Pricing Messaging, for now we'll use a simple RestSharp HTTP client
using RestSharp;
using RestSharp.Authenticators;
using System;
using System.Collections.Generic;

public class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        var client = new RestClient();
        client.Authenticator = new HttpBasicAuthenticator(accountSid, authToken);
        client.BaseUrl = new Uri("https://pricing.twilio.com/");

        var request = new RestRequest(Method.GET);
        request.Resource = $"v1/Messaging/Countries/EE";        
        var country = client.Execute<PricingMessagingCountry>(request).Data;
        
        foreach (var price in country.InboundSmsPrices)
        {
            Console.WriteLine(price.NumberType);
            Console.WriteLine($"Current price {price.CurrentPrice} {country.PriceUnit}");
        }
    }
}


class PricingMessagingCountry
{
    public string PriceUnit { get; set; }
    public List<SmsPrice> InboundSmsPrices { get; set; }
}

class SmsPrice
{
    public string NumberType { get; set; }
    public string BasePrice { get; set; }
    public string CurrentPrice { get; set; }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Pricing_Services_Twilio($sid, $token);

$country = $client->messagingCountries->get("EE");

foreach ($country->inbound_sms_prices as $p) {
    echo $p->number_type . " " . $p->current_price . "\n";
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::PricingClient.new account_sid, auth_token

@country = @client.messaging.countries.get('EE')
@country.inbound_sms_prices.each do |p|
  puts "#{p['number_type']} #{p['current_price']}"
end
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Pricing.V1.Messaging;

public class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var country = CountryResource.Fetch("EE");

        foreach (var price in country.InboundSmsPrices)
        {
            Console.WriteLine(price.CurrentPrice);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library

use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$country = $client->pricing->messaging->countries("EE")->fetch();

foreach ($country->inboundSmsPrices as $p) {
    echo "{$p["number_type"]} {$p["current_price"]}\n";
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioPricingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = TwilioPricingClient(account_sid, auth_token)
countries = client.messaging_countries().get("EE")

for p in countries.inbound_sms_prices:
    print("{} {}".format(p['number_type'], p['current_price']))

for op in countries.outbound_sms_prices:
    print("{}: {}".format(op['carrier'], op['prices']))
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

country = @client.pricing.messaging.countries('EE')
country.fetch.inbound_sms_prices.each do |p|
  puts "#{p['number_type']} #{p['current_price']}"
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioPricingClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.pricing.MessagingCountry;

public class Example {

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioPricingClient client = new TwilioPricingClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get Twilio Messaging pricing information for a specific country
    MessagingCountry mc = client.getMessagingCountry("EE");

    for (MessagingCountry.MessagingPrice p : mc.getInboundSmsPrices()) {
      // For each message pricing category, print number type and
      // current (reflecting any discounts your account has) price.
      System.out.println(p.getNumberType().toString());
      System.out.println(p.getCurrentPrice().toString());
    }
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

country = client.pricing \
                .messaging \
                .countries("EE") \
                .fetch()

for inbound_sms_price in country.inbound_sms_prices:
    number_type = inbound_sms_price['number_type']
    current_price = inbound_sms_price['current_price']
    print("{} {}".format(number_type, current_price))
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.pricing.v1.messaging.Country;
import com.twilio.type.InboundSmsPrice;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get Twilio Messaging pricing information for a specific country
    Country messagingCountry = Country.fetcher("EE").fetch();

    for (InboundSmsPrice price : messagingCountry.getInboundSmsPrices()) {
      // For each message pricing category, print number type and
      // current (reflecting any discounts your account has) price.
      System.out.println(price.getType());
      System.out.println(price.getCurrentPrice());
    }
  }
}
curl -XGET https://pricing.twilio.com/v1/Messaging/Countries/EE \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
  "url": "https://pricing.twilio.com/v1/Messaging/Countries/EE",
  "country": "Estonia",
  "iso_country": "EE",
  "price_unit": "USD",
  "outbound_sms_prices": [
    {
      "mcc": "248",
      "mnc": "1",
      "carrier": "EMT",
      "prices": [
        {
          "number_type": "mobile",
          "base_price": "0.1040",
          "current_price": "0.1040"
        },
        {
          "number_type": "local",
          "base_price": "0.1040",
          "current_price": "0.1040"
        }
      ]
    },
    {
      "mcc": "248",
      "mnc": "2",
      "carrier": "Elisa",
      "prices": [
        {
          "number_type": "mobile",
          "base_price": "0.0845",
          "current_price": "0.0845"
        },
        {
          "number_type": "local",
          "base_price": "0.0845",
          "current_price": "0.0845"
        }
      ]
    },
    {
      "mcc": "248",
      "mnc": "3",
      "carrier": "Tele2",
      "prices": [
        {
          "number_type": "mobile",
          "base_price": "0.050",
          "current_price": "0.050"
        },
        {
          "number_type": "local",
          "base_price": "0.050",
          "current_price": "0.050"
        }
      ]
    },
    {
      "mcc": "248",
      "mnc": "999",
      "carrier": "Other",
      "prices": [
        {
          "number_type": "mobile",
          "base_price": "0.02383",
          "current_price": "0.02383"
        },
        {
          "number_type": "local",
          "base_price": "0.02383",
          "current_price": "0.02383"
        }
      ]
    }
  ],
  "inbound_sms_prices": [
    {
      "number_type": "mobile",
      "base_price": "0.0075",
      "current_price": "0.0075"
    }
  ]
}
エストニアのメッセージ料金を探す

Pricing Messaging Country List Resource

リソース URL

https://pricing.twilio.com/v1/Messaging/Countries

HTTP GET

Returns a list of countries where Twilio messaging services are available and the corresponding URL for retrieving the country-specific messaging prices. This list includes paging information.

Twilio メッセージングサービスが提供されている国のリストを取得します。

コードサンプルを読み込んでいます...
Language
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const PricingClient = require('twilio').PricingClient;
const client = new PricingClient(accountSid, authToken);

client.messaging.countries.list((error, response) => {
  const cList = response.countries;
  for (let i = 0; i < cList.length; i++) {
    console.log(cList[i].isoCountry + '\n');
  }
});
// Get your Account SID and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

// Get twilio-node from twilio.com/docs/libraries/node
const client = require('twilio')(accountSid, authToken).pricing;

client.messaging.countries
  .list()
  .then(countriesList => {
    countriesList.forEach(country => {
      console.log(country.isoCountry);
    });
  })
  .catch(error => {
    console.log(error);
    throw error;
  });
// The C# helper library 5.x will support Pricing Messaging, for now we'll use a simple RestSharp HTTP client
using RestSharp;
using RestSharp.Authenticators;
using System;
using System.Collections.Generic;

class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        var client = new RestClient();
        client.Authenticator = new HttpBasicAuthenticator(accountSid, authToken);
        client.BaseUrl = new Uri("https://pricing.twilio.com/");

        var request = new RestRequest(Method.GET);
        request.Resource = "v1/Voice/Countries";
        var response = client.Execute<VoiceCountriesResponse>(request);

        while (response.Data.Meta.NextPageUrl != null)
        {
            foreach (var country in response.Data.Countries)
            {
                Console.WriteLine(country.IsoCountry);
            }

            request.Resource = response.Data.Meta.NextPageUrl.PathAndQuery;
            response = client.Execute<VoiceCountriesResponse>(request);
        }
    }
}


class VoiceCountry
{
    public string Country { get; set; }
    public string IsoCountry { get; set; }
    public Uri Url { get; set; }
}

class VoiceCountriesResponse
{
    public List<VoiceCountry> Countries { get; set; }
    public Meta Meta { get; set; }
}

class Meta
{
    public int Page { get; set; }
    public int PageSize { get; set; }
    public Uri FirstPageUrl { get; set; }
    public Uri PreviousPageUrl { get; set; }
    public Uri Url { get; set; }
    public Uri NextPageUrl { get; set; }
    public string Key { get; set; }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Pricing_Services_Twilio($sid, $token);

foreach ($client->messagingCountries as $c) {
    echo $c->iso_country . "\n";
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::PricingClient.new account_sid, auth_token

@countries = @client.messaging.countries.list
@countries.each do |c|
  puts c.iso_country
end
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Pricing.V1.Messaging;

public class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var countries = CountryResource.Read();

        foreach (var country in countries)
        {
            Console.WriteLine(country.IsoCountry);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library

use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$messagingCountries = $client->pricing->messaging->countries->stream();

foreach ($messagingCountries as $c) {
    echo $c->isoCountry;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioPricingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioPricingClient(account_sid, auth_token)

countries = client.messaging_countries().list()

for c in countries:
    print(c.iso_country)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

countries = @client.pricing.messaging.countries.list
countries.each do |c|
  puts c.iso_country
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioPricingClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.list.pricing.MessagingCountryList;
import com.twilio.sdk.resource.instance.pricing.MessagingCountry;

public class Example {

	// Find your Account Sid and Token at twilio.com/user/account
	public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	public static final String AUTH_TOKEN = "your_auth_token";

	public static void main(String[] args) throws TwilioRestException {
		TwilioPricingClient client = new TwilioPricingClient(ACCOUNT_SID, AUTH_TOKEN);

		// Get a list of countries where Twilio Messaging is available
		MessagingCountryList list = client.getMessagingCountries();

		for (MessagingCountry c : list.getPageData()) {
			System.out.println(c.getIsoCountry());
		}
	}
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

messaging_countries = client.pricing \
                            .messaging \
                            .countries \
                            .list()

for country in messaging_countries:
    print(country.iso_country)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.pricing.v1.messaging.Country;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get a list of countries where Twilio Messaging is available
    ResourceSet<Country> messagingCountries = Country.reader().read();

    for (Country country : messagingCountries) {
      System.out.println(country.getIsoCountry());
    }
  }
}
curl -XGET https://pricing.twilio.com/v1/Messaging/Countries \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
  "meta": {
    "page": 0,
    "page_size": 50,
    "first_page_url": "https://pricing.twilio.com/v1/Messaging/Countries?PageSize=50&Page=0",
    "previous_page_url": null,
    "url": "https://pricing.twilio.com/v1/Messaging/Countries?PageSize=50&Page=0",
    "next_page_url": "https://pricing.twilio.com/v1/Messaging/Countries?PageSize=50&Page=1&PageToken=DNCV",
    "key": "countries"
  },
  "countries": [
    {
      "country": "Andorra",
      "iso_country": "AD",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AD"
    },
    {
      "country": "United Arab Emirates",
      "iso_country": "AE",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AE"
    },
    {
      "country": "Afghanistan",
      "iso_country": "AF",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AF"
    },
    {
      "country": "Antigua and Barbuda",
      "iso_country": "AG",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AG"
    },
    {
      "country": "Anguilla",
      "iso_country": "AI",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AI"
    },
    {
      "country": "Albania",
      "iso_country": "AL",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AL"
    },
    {
      "country": "Armenia",
      "iso_country": "AM",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AM"
    },
    {
      "country": "Netherlands Antilles",
      "iso_country": "AN",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AN"
    },
    {
      "country": "Angola",
      "iso_country": "AO",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AO"
    },
    {
      "country": "Antarctica",
      "iso_country": "AQ",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AQ"
    },
    {
      "country": "Argentina",
      "iso_country": "AR",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AR"
    },
    {
      "country": "American Samoa",
      "iso_country": "AS",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AS"
    },
    {
      "country": "Austria",
      "iso_country": "AT",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AT"
    },
    {
      "country": "Australia",
      "iso_country": "AU",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AU"
    },
    {
      "country": "Aruba",
      "iso_country": "AW",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AW"
    },
    {
      "country": "Aland Islands",
      "iso_country": "AX",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AX"
    },
    {
      "country": "Azerbaijan",
      "iso_country": "AZ",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AZ"
    },
    {
      "country": "Bosnia and Herzegovina",
      "iso_country": "BA",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BA"
    },
    {
      "country": "Barbados",
      "iso_country": "BB",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BB"
    },
    {
      "country": "Bangladesh",
      "iso_country": "BD",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BD"
    },
    {
      "country": "Belgium",
      "iso_country": "BE",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BE"
    },
    {
      "country": "Burkina Faso",
      "iso_country": "BF",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BF"
    },
    {
      "country": "Bulgaria",
      "iso_country": "BG",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BG"
    },
    {
      "country": "Bahrain",
      "iso_country": "BH",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BH"
    },
    {
      "country": "Burundi",
      "iso_country": "BI",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BI"
    },
    {
      "country": "Benin",
      "iso_country": "BJ",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BJ"
    },
    {
      "country": "Bermuda",
      "iso_country": "BM",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BM"
    },
    {
      "country": "Brunei",
      "iso_country": "BN",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BN"
    },
    {
      "country": "Bolivia",
      "iso_country": "BO",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BO"
    },
    {
      "country": "Brazil",
      "iso_country": "BR",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BR"
    },
    {
      "country": "Bahamas",
      "iso_country": "BS",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BS"
    },
    {
      "country": "Bhutan",
      "iso_country": "BT",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BT"
    },
    {
      "country": "Botswana",
      "iso_country": "BW",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BW"
    },
    {
      "country": "Belarus",
      "iso_country": "BY",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BY"
    },
    {
      "country": "Belize",
      "iso_country": "BZ",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BZ"
    },
    {
      "country": "Canada",
      "iso_country": "CA",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CA"
    },
    {
      "country": "Cocos (Keeling) Islands",
      "iso_country": "CC",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CC"
    },
    {
      "country": "DR Congo",
      "iso_country": "CD",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CD"
    },
    {
      "country": "Central Africa",
      "iso_country": "CF",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CF"
    },
    {
      "country": "Congo",
      "iso_country": "CG",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CG"
    },
    {
      "country": "Switzerland",
      "iso_country": "CH",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CH"
    },
    {
      "country": "Ivory Coast",
      "iso_country": "CI",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CI"
    },
    {
      "country": "Cook Islands",
      "iso_country": "CK",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CK"
    },
    {
      "country": "Chile",
      "iso_country": "CL",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CL"
    },
    {
      "country": "Cameroon",
      "iso_country": "CM",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CM"
    },
    {
      "country": "China",
      "iso_country": "CN",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CN"
    },
    {
      "country": "Colombia",
      "iso_country": "CO",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CO"
    },
    {
      "country": "Costa Rica",
      "iso_country": "CR",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CR"
    },
    {
      "country": "Cuba",
      "iso_country": "CU",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CU"
    },
    {
      "country": "Cape Verde",
      "iso_country": "CV",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CV"
    }
  ]
}
メッセー対応の国を一覧する

ヘルプが必要ですか?

誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。

コードサンプルを読み込んでいます...
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const PricingClient = require('twilio').PricingClient;
const client = new PricingClient(accountSid, authToken);

client.messaging.countries('EE').get((err, country) => {
  const cpList = country.inboundSmsPrices;
  for (let i = 0; i < cpList.length; i++) {
    console.log(cpList[i].numberType + ' ' + cpList[i].currentPrice + '\n');
  }
});
// Get your Account SID and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

// Get twilio-node from twilio.com/docs/libraries/node
const client = require('twilio')(accountSid, authToken).pricing;

client.messaging
  .countries('EE')
  .fetch()
  .then(country => {
    country.inboundSmsPrices.forEach(price => {
      console.log(`${price.number_type} ${price.current_price}`);
    });
  })
  .catch(error => {
    console.log(error);
    throw error;
  });
// The C# helper library 5.x will support Pricing Messaging, for now we'll use a simple RestSharp HTTP client
using RestSharp;
using RestSharp.Authenticators;
using System;
using System.Collections.Generic;

public class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        var client = new RestClient();
        client.Authenticator = new HttpBasicAuthenticator(accountSid, authToken);
        client.BaseUrl = new Uri("https://pricing.twilio.com/");

        var request = new RestRequest(Method.GET);
        request.Resource = $"v1/Messaging/Countries/EE";        
        var country = client.Execute<PricingMessagingCountry>(request).Data;
        
        foreach (var price in country.InboundSmsPrices)
        {
            Console.WriteLine(price.NumberType);
            Console.WriteLine($"Current price {price.CurrentPrice} {country.PriceUnit}");
        }
    }
}


class PricingMessagingCountry
{
    public string PriceUnit { get; set; }
    public List<SmsPrice> InboundSmsPrices { get; set; }
}

class SmsPrice
{
    public string NumberType { get; set; }
    public string BasePrice { get; set; }
    public string CurrentPrice { get; set; }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Pricing_Services_Twilio($sid, $token);

$country = $client->messagingCountries->get("EE");

foreach ($country->inbound_sms_prices as $p) {
    echo $p->number_type . " " . $p->current_price . "\n";
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::PricingClient.new account_sid, auth_token

@country = @client.messaging.countries.get('EE')
@country.inbound_sms_prices.each do |p|
  puts "#{p['number_type']} #{p['current_price']}"
end
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Pricing.V1.Messaging;

public class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var country = CountryResource.Fetch("EE");

        foreach (var price in country.InboundSmsPrices)
        {
            Console.WriteLine(price.CurrentPrice);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library

use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$country = $client->pricing->messaging->countries("EE")->fetch();

foreach ($country->inboundSmsPrices as $p) {
    echo "{$p["number_type"]} {$p["current_price"]}\n";
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioPricingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = TwilioPricingClient(account_sid, auth_token)
countries = client.messaging_countries().get("EE")

for p in countries.inbound_sms_prices:
    print("{} {}".format(p['number_type'], p['current_price']))

for op in countries.outbound_sms_prices:
    print("{}: {}".format(op['carrier'], op['prices']))
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

country = @client.pricing.messaging.countries('EE')
country.fetch.inbound_sms_prices.each do |p|
  puts "#{p['number_type']} #{p['current_price']}"
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioPricingClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.pricing.MessagingCountry;

public class Example {

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioPricingClient client = new TwilioPricingClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get Twilio Messaging pricing information for a specific country
    MessagingCountry mc = client.getMessagingCountry("EE");

    for (MessagingCountry.MessagingPrice p : mc.getInboundSmsPrices()) {
      // For each message pricing category, print number type and
      // current (reflecting any discounts your account has) price.
      System.out.println(p.getNumberType().toString());
      System.out.println(p.getCurrentPrice().toString());
    }
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"

client = Client(account_sid, auth_token)

country = client.pricing \
                .messaging \
                .countries("EE") \
                .fetch()

for inbound_sms_price in country.inbound_sms_prices:
    number_type = inbound_sms_price['number_type']
    current_price = inbound_sms_price['current_price']
    print("{} {}".format(number_type, current_price))
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.pricing.v1.messaging.Country;
import com.twilio.type.InboundSmsPrice;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get Twilio Messaging pricing information for a specific country
    Country messagingCountry = Country.fetcher("EE").fetch();

    for (InboundSmsPrice price : messagingCountry.getInboundSmsPrices()) {
      // For each message pricing category, print number type and
      // current (reflecting any discounts your account has) price.
      System.out.println(price.getType());
      System.out.println(price.getCurrentPrice());
    }
  }
}
curl -XGET https://pricing.twilio.com/v1/Messaging/Countries/EE \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
  "url": "https://pricing.twilio.com/v1/Messaging/Countries/EE",
  "country": "Estonia",
  "iso_country": "EE",
  "price_unit": "USD",
  "outbound_sms_prices": [
    {
      "mcc": "248",
      "mnc": "1",
      "carrier": "EMT",
      "prices": [
        {
          "number_type": "mobile",
          "base_price": "0.1040",
          "current_price": "0.1040"
        },
        {
          "number_type": "local",
          "base_price": "0.1040",
          "current_price": "0.1040"
        }
      ]
    },
    {
      "mcc": "248",
      "mnc": "2",
      "carrier": "Elisa",
      "prices": [
        {
          "number_type": "mobile",
          "base_price": "0.0845",
          "current_price": "0.0845"
        },
        {
          "number_type": "local",
          "base_price": "0.0845",
          "current_price": "0.0845"
        }
      ]
    },
    {
      "mcc": "248",
      "mnc": "3",
      "carrier": "Tele2",
      "prices": [
        {
          "number_type": "mobile",
          "base_price": "0.050",
          "current_price": "0.050"
        },
        {
          "number_type": "local",
          "base_price": "0.050",
          "current_price": "0.050"
        }
      ]
    },
    {
      "mcc": "248",
      "mnc": "999",
      "carrier": "Other",
      "prices": [
        {
          "number_type": "mobile",
          "base_price": "0.02383",
          "current_price": "0.02383"
        },
        {
          "number_type": "local",
          "base_price": "0.02383",
          "current_price": "0.02383"
        }
      ]
    }
  ],
  "inbound_sms_prices": [
    {
      "number_type": "mobile",
      "base_price": "0.0075",
      "current_price": "0.0075"
    }
  ]
}
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const PricingClient = require('twilio').PricingClient;
const client = new PricingClient(accountSid, authToken);

client.messaging.countries.list((error, response) => {
  const cList = response.countries;
  for (let i = 0; i < cList.length; i++) {
    console.log(cList[i].isoCountry + '\n');
  }
});
// Get your Account SID and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

// Get twilio-node from twilio.com/docs/libraries/node
const client = require('twilio')(accountSid, authToken).pricing;

client.messaging.countries
  .list()
  .then(countriesList => {
    countriesList.forEach(country => {
      console.log(country.isoCountry);
    });
  })
  .catch(error => {
    console.log(error);
    throw error;
  });
// The C# helper library 5.x will support Pricing Messaging, for now we'll use a simple RestSharp HTTP client
using RestSharp;
using RestSharp.Authenticators;
using System;
using System.Collections.Generic;

class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        var client = new RestClient();
        client.Authenticator = new HttpBasicAuthenticator(accountSid, authToken);
        client.BaseUrl = new Uri("https://pricing.twilio.com/");

        var request = new RestRequest(Method.GET);
        request.Resource = "v1/Voice/Countries";
        var response = client.Execute<VoiceCountriesResponse>(request);

        while (response.Data.Meta.NextPageUrl != null)
        {
            foreach (var country in response.Data.Countries)
            {
                Console.WriteLine(country.IsoCountry);
            }

            request.Resource = response.Data.Meta.NextPageUrl.PathAndQuery;
            response = client.Execute<VoiceCountriesResponse>(request);
        }
    }
}


class VoiceCountry
{
    public string Country { get; set; }
    public string IsoCountry { get; set; }
    public Uri Url { get; set; }
}

class VoiceCountriesResponse
{
    public List<VoiceCountry> Countries { get; set; }
    public Meta Meta { get; set; }
}

class Meta
{
    public int Page { get; set; }
    public int PageSize { get; set; }
    public Uri FirstPageUrl { get; set; }
    public Uri PreviousPageUrl { get; set; }
    public Uri Url { get; set; }
    public Uri NextPageUrl { get; set; }
    public string Key { get; set; }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Pricing_Services_Twilio($sid, $token);

foreach ($client->messagingCountries as $c) {
    echo $c->iso_country . "\n";
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::PricingClient.new account_sid, auth_token

@countries = @client.messaging.countries.list
@countries.each do |c|
  puts c.iso_country
end
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Pricing.V1.Messaging;

public class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var countries = CountryResource.Read();

        foreach (var country in countries)
        {
            Console.WriteLine(country.IsoCountry);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library

use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$messagingCountries = $client->pricing->messaging->countries->stream();

foreach ($messagingCountries as $c) {
    echo $c->isoCountry;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioPricingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioPricingClient(account_sid, auth_token)

countries = client.messaging_countries().list()

for c in countries:
    print(c.iso_country)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

countries = @client.pricing.messaging.countries.list
countries.each do |c|
  puts c.iso_country
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioPricingClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.list.pricing.MessagingCountryList;
import com.twilio.sdk.resource.instance.pricing.MessagingCountry;

public class Example {

	// Find your Account Sid and Token at twilio.com/user/account
	public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	public static final String AUTH_TOKEN = "your_auth_token";

	public static void main(String[] args) throws TwilioRestException {
		TwilioPricingClient client = new TwilioPricingClient(ACCOUNT_SID, AUTH_TOKEN);

		// Get a list of countries where Twilio Messaging is available
		MessagingCountryList list = client.getMessagingCountries();

		for (MessagingCountry c : list.getPageData()) {
			System.out.println(c.getIsoCountry());
		}
	}
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

messaging_countries = client.pricing \
                            .messaging \
                            .countries \
                            .list()

for country in messaging_countries:
    print(country.iso_country)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.pricing.v1.messaging.Country;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get a list of countries where Twilio Messaging is available
    ResourceSet<Country> messagingCountries = Country.reader().read();

    for (Country country : messagingCountries) {
      System.out.println(country.getIsoCountry());
    }
  }
}
curl -XGET https://pricing.twilio.com/v1/Messaging/Countries \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
  "meta": {
    "page": 0,
    "page_size": 50,
    "first_page_url": "https://pricing.twilio.com/v1/Messaging/Countries?PageSize=50&Page=0",
    "previous_page_url": null,
    "url": "https://pricing.twilio.com/v1/Messaging/Countries?PageSize=50&Page=0",
    "next_page_url": "https://pricing.twilio.com/v1/Messaging/Countries?PageSize=50&Page=1&PageToken=DNCV",
    "key": "countries"
  },
  "countries": [
    {
      "country": "Andorra",
      "iso_country": "AD",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AD"
    },
    {
      "country": "United Arab Emirates",
      "iso_country": "AE",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AE"
    },
    {
      "country": "Afghanistan",
      "iso_country": "AF",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AF"
    },
    {
      "country": "Antigua and Barbuda",
      "iso_country": "AG",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AG"
    },
    {
      "country": "Anguilla",
      "iso_country": "AI",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AI"
    },
    {
      "country": "Albania",
      "iso_country": "AL",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AL"
    },
    {
      "country": "Armenia",
      "iso_country": "AM",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AM"
    },
    {
      "country": "Netherlands Antilles",
      "iso_country": "AN",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AN"
    },
    {
      "country": "Angola",
      "iso_country": "AO",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AO"
    },
    {
      "country": "Antarctica",
      "iso_country": "AQ",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AQ"
    },
    {
      "country": "Argentina",
      "iso_country": "AR",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AR"
    },
    {
      "country": "American Samoa",
      "iso_country": "AS",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AS"
    },
    {
      "country": "Austria",
      "iso_country": "AT",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AT"
    },
    {
      "country": "Australia",
      "iso_country": "AU",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AU"
    },
    {
      "country": "Aruba",
      "iso_country": "AW",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AW"
    },
    {
      "country": "Aland Islands",
      "iso_country": "AX",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AX"
    },
    {
      "country": "Azerbaijan",
      "iso_country": "AZ",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/AZ"
    },
    {
      "country": "Bosnia and Herzegovina",
      "iso_country": "BA",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BA"
    },
    {
      "country": "Barbados",
      "iso_country": "BB",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BB"
    },
    {
      "country": "Bangladesh",
      "iso_country": "BD",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BD"
    },
    {
      "country": "Belgium",
      "iso_country": "BE",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BE"
    },
    {
      "country": "Burkina Faso",
      "iso_country": "BF",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BF"
    },
    {
      "country": "Bulgaria",
      "iso_country": "BG",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BG"
    },
    {
      "country": "Bahrain",
      "iso_country": "BH",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BH"
    },
    {
      "country": "Burundi",
      "iso_country": "BI",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BI"
    },
    {
      "country": "Benin",
      "iso_country": "BJ",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BJ"
    },
    {
      "country": "Bermuda",
      "iso_country": "BM",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BM"
    },
    {
      "country": "Brunei",
      "iso_country": "BN",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BN"
    },
    {
      "country": "Bolivia",
      "iso_country": "BO",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BO"
    },
    {
      "country": "Brazil",
      "iso_country": "BR",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BR"
    },
    {
      "country": "Bahamas",
      "iso_country": "BS",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BS"
    },
    {
      "country": "Bhutan",
      "iso_country": "BT",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BT"
    },
    {
      "country": "Botswana",
      "iso_country": "BW",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BW"
    },
    {
      "country": "Belarus",
      "iso_country": "BY",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BY"
    },
    {
      "country": "Belize",
      "iso_country": "BZ",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/BZ"
    },
    {
      "country": "Canada",
      "iso_country": "CA",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CA"
    },
    {
      "country": "Cocos (Keeling) Islands",
      "iso_country": "CC",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CC"
    },
    {
      "country": "DR Congo",
      "iso_country": "CD",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CD"
    },
    {
      "country": "Central Africa",
      "iso_country": "CF",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CF"
    },
    {
      "country": "Congo",
      "iso_country": "CG",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CG"
    },
    {
      "country": "Switzerland",
      "iso_country": "CH",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CH"
    },
    {
      "country": "Ivory Coast",
      "iso_country": "CI",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CI"
    },
    {
      "country": "Cook Islands",
      "iso_country": "CK",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CK"
    },
    {
      "country": "Chile",
      "iso_country": "CL",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CL"
    },
    {
      "country": "Cameroon",
      "iso_country": "CM",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CM"
    },
    {
      "country": "China",
      "iso_country": "CN",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CN"
    },
    {
      "country": "Colombia",
      "iso_country": "CO",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CO"
    },
    {
      "country": "Costa Rica",
      "iso_country": "CR",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CR"
    },
    {
      "country": "Cuba",
      "iso_country": "CU",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CU"
    },
    {
      "country": "Cape Verde",
      "iso_country": "CV",
      "url": "https://pricing.twilio.com/v1/Messaging/Countries/CV"
    }
  ]
}