View a list of faxes
GET
/
faxes
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const fax of client.faxes.list()) {
console.log(fax.id);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.faxes.list()
page = page.data[0]
print(page.id)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"),
)
page, err := client.Faxes.List(context.TODO(), telnyx.FaxListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.faxes.FaxListPage;
import com.telnyx.sdk.models.faxes.FaxListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
FaxListPage page = client.faxes().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.faxes.list
puts(page)<?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 {
$page = $client->faxes->list(
filter: [
'createdAt' => [
'gt' => new \DateTimeImmutable('2020-02-02T22:25:27.521992Z'),
'gte' => new \DateTimeImmutable('2020-02-02T22:25:27.521992Z'),
'lt' => new \DateTimeImmutable('2020-02-02T22:25:27.521992Z'),
'lte' => new \DateTimeImmutable('2020-02-02T22:25:27.521992Z'),
],
'direction' => ['eq' => 'inbound'],
'from' => ['eq' => '+13127367276'],
'to' => ['eq' => '+13127367276'],
],
pageNumber: 0,
pageSize: 0,
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx faxes list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/faxes \
--header 'Authorization: Bearer <token>'{
"data": [
{
"record_type": "fax",
"id": "0ccc7b54-4df3-4bca-a65a-3da1ecc777f0",
"connection_id": "c-1",
"direction": "outbound",
"from": "+123",
"to": "+456",
"media_url": "http://www.example.com/fax.pdf",
"store_media": true,
"stored_media_url": "https://s3.amazonaws.com/faxes-dev/user-1/cf4a6b52-bf8e-4945-9f49-611d0d2b083b.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=xxxxxxxxxx%2F20200505%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200505T095917Z&X-Amz-Expires=7200&X-Amz-SignedHeaders=host&X-Amz-Signature=fac2af40464fcc77673ad762db86e34f9c1b91a82699b5578c5327f53874df51",
"preview_url": "https://s3.amazonaws.com/faxes-dev/user-1/cf4a6b52-bf8e-4945-9f49-611d0d2b083b_preview.tiff?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=xxxxxxxxxx%2F20200505%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200505T095917Z&X-Amz-Expires=7200&X-Amz-SignedHeaders=host&X-Amz-Signature=fac2af40464fcc77673ad762db86e34f9c1b91a82699b5578c5327f53874df51",
"quality": "high",
"webhook_url": "http://www.example.com/webhooks",
"webhook_failover_url": "",
"status": "queued",
"failure_reason": null,
"internal_failure_reason": null,
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"created_at": "2020-05-05T09:59:12Z",
"updated_at": "2020-05-05T09:59:12Z"
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}{
"errors": [
{
"code": "404",
"title": "Not Found",
"detail": "The requested resource does not exist"
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Consolidated filter parameter (deepObject style). Originally: filter[created_at][gte], filter[created_at][gt], filter[created_at][lte], filter[created_at][lt], filter[direction][eq], filter[from][eq], filter[to][eq]
Show child attributes
Show child attributes
Consolidated pagination parameter (deepObject style). Originally: page[size], page[number]
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
});
// Automatically fetches more pages as needed.
for await (const fax of client.faxes.list()) {
console.log(fax.id);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.faxes.list()
page = page.data[0]
print(page.id)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"),
)
page, err := client.Faxes.List(context.TODO(), telnyx.FaxListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.faxes.FaxListPage;
import com.telnyx.sdk.models.faxes.FaxListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
FaxListPage page = client.faxes().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.faxes.list
puts(page)<?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 {
$page = $client->faxes->list(
filter: [
'createdAt' => [
'gt' => new \DateTimeImmutable('2020-02-02T22:25:27.521992Z'),
'gte' => new \DateTimeImmutable('2020-02-02T22:25:27.521992Z'),
'lt' => new \DateTimeImmutable('2020-02-02T22:25:27.521992Z'),
'lte' => new \DateTimeImmutable('2020-02-02T22:25:27.521992Z'),
],
'direction' => ['eq' => 'inbound'],
'from' => ['eq' => '+13127367276'],
'to' => ['eq' => '+13127367276'],
],
pageNumber: 0,
pageSize: 0,
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx faxes list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/faxes \
--header 'Authorization: Bearer <token>'{
"data": [
{
"record_type": "fax",
"id": "0ccc7b54-4df3-4bca-a65a-3da1ecc777f0",
"connection_id": "c-1",
"direction": "outbound",
"from": "+123",
"to": "+456",
"media_url": "http://www.example.com/fax.pdf",
"store_media": true,
"stored_media_url": "https://s3.amazonaws.com/faxes-dev/user-1/cf4a6b52-bf8e-4945-9f49-611d0d2b083b.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=xxxxxxxxxx%2F20200505%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200505T095917Z&X-Amz-Expires=7200&X-Amz-SignedHeaders=host&X-Amz-Signature=fac2af40464fcc77673ad762db86e34f9c1b91a82699b5578c5327f53874df51",
"preview_url": "https://s3.amazonaws.com/faxes-dev/user-1/cf4a6b52-bf8e-4945-9f49-611d0d2b083b_preview.tiff?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=xxxxxxxxxx%2F20200505%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200505T095917Z&X-Amz-Expires=7200&X-Amz-SignedHeaders=host&X-Amz-Signature=fac2af40464fcc77673ad762db86e34f9c1b91a82699b5578c5327f53874df51",
"quality": "high",
"webhook_url": "http://www.example.com/webhooks",
"webhook_failover_url": "",
"status": "queued",
"failure_reason": null,
"internal_failure_reason": null,
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"created_at": "2020-05-05T09:59:12Z",
"updated_at": "2020-05-05T09:59:12Z"
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}{
"errors": [
{
"code": "404",
"title": "Not Found",
"detail": "The requested resource does not exist"
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}