Get coverage for a specific country
Get coverage for a specific country
GET
/
country_coverage
/
countries
/
{country_code}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.countryCoverage.retrieveCountry('US');
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.country_coverage.retrieve_country(
"US",
)
print(response.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.CountryCoverage.GetCountry(context.TODO(), "US")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.countrycoverage.CountryCoverageRetrieveCountryParams;
import com.telnyx.sdk.models.countrycoverage.CountryCoverageRetrieveCountryResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CountryCoverageRetrieveCountryResponse response = client.countryCoverage().retrieveCountry("US");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.country_coverage.retrieve_country("US")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->countryCoverage->retrieveCountry('US');
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx country-coverage retrieve-country \
--api-key 'My API Key' \
--country-code UScurl --request GET \
--url https://api.telnyx.com/v2/country_coverage/countries/{country_code} \
--header 'Authorization: Bearer <token>'{
"data": {
"code": "US",
"numbers": true,
"features": [
"hd_voice",
"emergency",
"voice",
"mms",
"fax",
"sms",
"international_sms"
],
"phone_number_type": [
"local",
"local",
"local",
"toll_free"
],
"reservable": true,
"quickship": true,
"international_sms": true,
"p2p": true,
"local": {
"features": [
"hd_voice",
"voice",
"international_sms",
"mms",
"fax",
"sms",
"emergency"
],
"reservable": true,
"quickship": false,
"international_sms": true,
"p2p": true,
"full_pstn_replacement": true
},
"toll_free": {
"features": [
"voice",
"mms",
"fax",
"sms",
"emergency"
],
"reservable": true,
"quickship": true,
"international_sms": false,
"p2p": false,
"full_pstn_replacement": false
},
"mobile": {},
"national": {},
"inventory_coverage": true,
"shared_cost": {},
"region": "AMER"
}
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not understand the provided credentials.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Country ISO code.
Example:
"US"
Response
Response for specific country coverage
Show child attributes
Show child attributes
Example:
{
"code": "US",
"numbers": true,
"features": [
"hd_voice",
"emergency",
"voice",
"mms",
"fax",
"sms",
"international_sms"
],
"phone_number_type": ["local", "local", "local", "toll_free"],
"reservable": true,
"quickship": true,
"international_sms": true,
"p2p": true,
"local": {
"features": [
"hd_voice",
"voice",
"international_sms",
"mms",
"fax",
"sms",
"emergency"
],
"reservable": true,
"quickship": false,
"international_sms": true,
"p2p": true,
"full_pstn_replacement": true
},
"toll_free": {
"features": ["voice", "mms", "fax", "sms", "emergency"],
"reservable": true,
"quickship": true,
"international_sms": false,
"p2p": false,
"full_pstn_replacement": false
},
"mobile": {},
"national": {},
"inventory_coverage": true,
"shared_cost": {},
"region": "AMER"
}
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.countryCoverage.retrieveCountry('US');
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.country_coverage.retrieve_country(
"US",
)
print(response.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.CountryCoverage.GetCountry(context.TODO(), "US")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.countrycoverage.CountryCoverageRetrieveCountryParams;
import com.telnyx.sdk.models.countrycoverage.CountryCoverageRetrieveCountryResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CountryCoverageRetrieveCountryResponse response = client.countryCoverage().retrieveCountry("US");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.country_coverage.retrieve_country("US")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->countryCoverage->retrieveCountry('US');
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx country-coverage retrieve-country \
--api-key 'My API Key' \
--country-code UScurl --request GET \
--url https://api.telnyx.com/v2/country_coverage/countries/{country_code} \
--header 'Authorization: Bearer <token>'{
"data": {
"code": "US",
"numbers": true,
"features": [
"hd_voice",
"emergency",
"voice",
"mms",
"fax",
"sms",
"international_sms"
],
"phone_number_type": [
"local",
"local",
"local",
"toll_free"
],
"reservable": true,
"quickship": true,
"international_sms": true,
"p2p": true,
"local": {
"features": [
"hd_voice",
"voice",
"international_sms",
"mms",
"fax",
"sms",
"emergency"
],
"reservable": true,
"quickship": false,
"international_sms": true,
"p2p": true,
"full_pstn_replacement": true
},
"toll_free": {
"features": [
"voice",
"mms",
"fax",
"sms",
"emergency"
],
"reservable": true,
"quickship": true,
"international_sms": false,
"p2p": false,
"full_pstn_replacement": false
},
"mobile": {},
"national": {},
"inventory_coverage": true,
"shared_cost": {},
"region": "AMER"
}
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not understand the provided credentials.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}