Verify CSR phone number coverage
Verify the coverage for a list of phone numbers.
POST
/
customer_service_records
/
phone_number_coverages
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.customerServiceRecords.verifyPhoneNumberCoverage({
phone_numbers: ['+13035553000'],
});
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.customer_service_records.verify_phone_number_coverage(
phone_numbers=["+13035553000"],
)
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.CustomerServiceRecords.VerifyPhoneNumberCoverage(context.TODO(), telnyx.CustomerServiceRecordVerifyPhoneNumberCoverageParams{
PhoneNumbers: []string{"+13035553000"},
})
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.customerservicerecords.CustomerServiceRecordVerifyPhoneNumberCoverageParams;
import com.telnyx.sdk.models.customerservicerecords.CustomerServiceRecordVerifyPhoneNumberCoverageResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CustomerServiceRecordVerifyPhoneNumberCoverageParams params = CustomerServiceRecordVerifyPhoneNumberCoverageParams.builder()
.addPhoneNumber("+13035553000")
.build();
CustomerServiceRecordVerifyPhoneNumberCoverageResponse response = client.customerServiceRecords().verifyPhoneNumberCoverage(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.customer_service_records.verify_phone_number_coverage(phone_numbers: ["+13035553000"])
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->customerServiceRecords->verifyPhoneNumberCoverage(
phoneNumbers: ['+13035553000']
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx customer-service-records verify-phone-number-coverage \
--api-key 'My API Key' \
--phone-number "'+13035553000'"curl --request POST \
--url https://api.telnyx.com/v2/customer_service_records/phone_number_coverages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_numbers": [
"+13035553000"
]
}
'{
"data": [
{
"phone_number": "+12223334444",
"has_csr_coverage": true,
"reason": "The phone number '+19999999999' is invalid.",
"additional_data_required": [
"name"
],
"record_type": "customer_service_record_phone_number_coverage"
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "The required authentication headers were either invalid or not included in the request.",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "10010",
"title": "Authorization failed",
"detail": "You do not have permission to perform the requested action on the specified resource or resources.",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10010"
}
}
]
}{
"errors": [
{
"code": "10002",
"title": "Invalid phone number",
"detail": "The phone number is invalid.",
"source": {
"pointer": "/phone_numbers",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10002"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occurred.",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10007"
}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The phone numbers list to be verified.
A valid US phone number in E164 format.
Pattern:
^\+1\d{10}$Response
Successful Response
Show child attributes
Show child attributes
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.customerServiceRecords.verifyPhoneNumberCoverage({
phone_numbers: ['+13035553000'],
});
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.customer_service_records.verify_phone_number_coverage(
phone_numbers=["+13035553000"],
)
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.CustomerServiceRecords.VerifyPhoneNumberCoverage(context.TODO(), telnyx.CustomerServiceRecordVerifyPhoneNumberCoverageParams{
PhoneNumbers: []string{"+13035553000"},
})
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.customerservicerecords.CustomerServiceRecordVerifyPhoneNumberCoverageParams;
import com.telnyx.sdk.models.customerservicerecords.CustomerServiceRecordVerifyPhoneNumberCoverageResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CustomerServiceRecordVerifyPhoneNumberCoverageParams params = CustomerServiceRecordVerifyPhoneNumberCoverageParams.builder()
.addPhoneNumber("+13035553000")
.build();
CustomerServiceRecordVerifyPhoneNumberCoverageResponse response = client.customerServiceRecords().verifyPhoneNumberCoverage(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.customer_service_records.verify_phone_number_coverage(phone_numbers: ["+13035553000"])
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->customerServiceRecords->verifyPhoneNumberCoverage(
phoneNumbers: ['+13035553000']
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx customer-service-records verify-phone-number-coverage \
--api-key 'My API Key' \
--phone-number "'+13035553000'"curl --request POST \
--url https://api.telnyx.com/v2/customer_service_records/phone_number_coverages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_numbers": [
"+13035553000"
]
}
'{
"data": [
{
"phone_number": "+12223334444",
"has_csr_coverage": true,
"reason": "The phone number '+19999999999' is invalid.",
"additional_data_required": [
"name"
],
"record_type": "customer_service_record_phone_number_coverage"
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "The required authentication headers were either invalid or not included in the request.",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "10010",
"title": "Authorization failed",
"detail": "You do not have permission to perform the requested action on the specified resource or resources.",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10010"
}
}
]
}{
"errors": [
{
"code": "10002",
"title": "Invalid phone number",
"detail": "The phone number is invalid.",
"source": {
"pointer": "/phone_numbers",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10002"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occurred.",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10007"
}
}
]
}