Create a CSV download
POST
/
phone_numbers
/
csv_downloads
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const csvDownload = await client.phoneNumbers.csvDownloads.create();
console.log(csvDownload.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
)
csv_download = client.phone_numbers.csv_downloads.create()
print(csv_download.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"),
)
csvDownload, err := client.PhoneNumbers.CsvDownloads.New(context.TODO(), telnyx.PhoneNumberCsvDownloadNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", csvDownload.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.phonenumbers.csvdownloads.CsvDownloadCreateParams;
import com.telnyx.sdk.models.phonenumbers.csvdownloads.CsvDownloadCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CsvDownloadCreateResponse csvDownload = client.phoneNumbers().csvDownloads().create();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
csv_download = telnyx.phone_numbers.csv_downloads.create
puts(csv_download)<?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 {
$csvDownload = $client->phoneNumbers->csvDownloads->create(
csvFormat: 'V2',
filter: [
'billingGroupID' => '62e4bf2e-c278-4282-b524-488d9c9c43b2',
'connectionID' => '1521916448077776306',
'customerReference' => 'customer_reference',
'emergencyAddressID' => '9102160989215728032',
'hasBundle' => 'has_bundle',
'phoneNumber' => 'phone_number',
'status' => 'active',
'tag' => 'tag',
'voiceConnectionName' => [
'contains' => 'test',
'endsWith' => 'test',
'eq' => 'test',
'startsWith' => 'test',
],
'voiceUsagePaymentMethod' => 'channel',
],
);
var_dump($csvDownload);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx phone-numbers:csv-downloads create \
--api-key 'My API Key'curl --request POST \
--url https://api.telnyx.com/v2/phone_numbers/csv_downloads \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "42587e44-3a3e-46de-9255-0c9a7a1d1ec7",
"record_type": "csv_download",
"url": "https://www.telnyx.com/sample/42587e44-3a3e-46de-9255-0c9a7a1d1ec7",
"status": "pending"
}
]
}{
"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.
Query Parameters
Which format to use when generating the CSV file. The default for backwards compatibility is 'V1'
Available options:
V1, V2 Example:
"V2"
Consolidated filter parameter (deepObject style). Originally: filter[has_bundle], filter[tag], filter[connection_id], filter[phone_number], filter[status], filter[voice.connection_name], filter[voice.usage_payment_method], filter[billing_group_id], filter[emergency_address_id], filter[customer_reference]
Show child attributes
Show child attributes
Response
Successful response with details about a CSV download.
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 csvDownload = await client.phoneNumbers.csvDownloads.create();
console.log(csvDownload.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
)
csv_download = client.phone_numbers.csv_downloads.create()
print(csv_download.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"),
)
csvDownload, err := client.PhoneNumbers.CsvDownloads.New(context.TODO(), telnyx.PhoneNumberCsvDownloadNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", csvDownload.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.phonenumbers.csvdownloads.CsvDownloadCreateParams;
import com.telnyx.sdk.models.phonenumbers.csvdownloads.CsvDownloadCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CsvDownloadCreateResponse csvDownload = client.phoneNumbers().csvDownloads().create();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
csv_download = telnyx.phone_numbers.csv_downloads.create
puts(csv_download)<?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 {
$csvDownload = $client->phoneNumbers->csvDownloads->create(
csvFormat: 'V2',
filter: [
'billingGroupID' => '62e4bf2e-c278-4282-b524-488d9c9c43b2',
'connectionID' => '1521916448077776306',
'customerReference' => 'customer_reference',
'emergencyAddressID' => '9102160989215728032',
'hasBundle' => 'has_bundle',
'phoneNumber' => 'phone_number',
'status' => 'active',
'tag' => 'tag',
'voiceConnectionName' => [
'contains' => 'test',
'endsWith' => 'test',
'eq' => 'test',
'startsWith' => 'test',
],
'voiceUsagePaymentMethod' => 'channel',
],
);
var_dump($csvDownload);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx phone-numbers:csv-downloads create \
--api-key 'My API Key'curl --request POST \
--url https://api.telnyx.com/v2/phone_numbers/csv_downloads \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "42587e44-3a3e-46de-9255-0c9a7a1d1ec7",
"record_type": "csv_download",
"url": "https://www.telnyx.com/sample/42587e44-3a3e-46de-9255-0c9a7a1d1ec7",
"status": "pending"
}
]
}{
"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"
}
}
]
}