List customer service records
List customer service records.
GET
/
customer_service_records
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 customerServiceRecord of client.customerServiceRecords.list()) {
console.log(customerServiceRecord.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.customer_service_records.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.CustomerServiceRecords.List(context.TODO(), telnyx.CustomerServiceRecordListParams{})
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.customerservicerecords.CustomerServiceRecordListPage;
import com.telnyx.sdk.models.customerservicerecords.CustomerServiceRecordListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CustomerServiceRecordListPage page = client.customerServiceRecords().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.customer_service_records.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->customerServiceRecords->list(
filter: [
'createdAt' => [
'gt' => new \DateTimeImmutable('2020-01-01T00:00:00Z'),
'lt' => new \DateTimeImmutable('2020-01-01T00:00:00Z'),
],
'phoneNumber' => ['eq' => '+12441239999', 'in' => ['+12441239999']],
'status' => ['eq' => 'pending', 'in' => ['pending']],
],
pageNumber: 0,
pageSize: 0,
sort: ['value' => 'created_at'],
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx customer-service-records list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/customer_service_records \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "f1486bae-f067-460c-ad43-73a92848f902",
"phone_number": "+12065551212",
"status": "completed",
"error_message": "CSR information not available.",
"result": {
"carrier_name": "ABC CARRIER, INC.",
"associated_phone_numbers": [
"+12065551212"
],
"admin": {
"name": "John Doe",
"billing_phone_number": "+12065551212",
"account_number": "1234567890",
"authorized_person_name": "John Doe"
},
"address": {
"administrative_area": "NY",
"locality": "New York",
"postal_code": "10001",
"street_address": "123 Main St",
"full_address": "123 Main St; New York; NY; 10001"
}
},
"webhook_url": "https://example.com/webhook",
"record_type": "customer_service_record",
"created_at": "2021-03-19T10:07:15.527Z",
"updated_at": "2021-03-19T10:07:15.527Z"
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}{
"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.
Query Parameters
Consolidated page parameter (deepObject style). Originally: page[size], page[number]
Show child attributes
Show child attributes
Consolidated filter parameter (deepObject style). Originally: filter[phone_number][eq], filter[phone_number][in][], filter[status][eq], filter[status][in][], filter[created_at][lt], filter[created_at][gt]
Show child attributes
Show child attributes
Consolidated sort parameter (deepObject style). Originally: sort[value]
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 customerServiceRecord of client.customerServiceRecords.list()) {
console.log(customerServiceRecord.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.customer_service_records.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.CustomerServiceRecords.List(context.TODO(), telnyx.CustomerServiceRecordListParams{})
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.customerservicerecords.CustomerServiceRecordListPage;
import com.telnyx.sdk.models.customerservicerecords.CustomerServiceRecordListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CustomerServiceRecordListPage page = client.customerServiceRecords().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.customer_service_records.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->customerServiceRecords->list(
filter: [
'createdAt' => [
'gt' => new \DateTimeImmutable('2020-01-01T00:00:00Z'),
'lt' => new \DateTimeImmutable('2020-01-01T00:00:00Z'),
],
'phoneNumber' => ['eq' => '+12441239999', 'in' => ['+12441239999']],
'status' => ['eq' => 'pending', 'in' => ['pending']],
],
pageNumber: 0,
pageSize: 0,
sort: ['value' => 'created_at'],
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx customer-service-records list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/customer_service_records \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "f1486bae-f067-460c-ad43-73a92848f902",
"phone_number": "+12065551212",
"status": "completed",
"error_message": "CSR information not available.",
"result": {
"carrier_name": "ABC CARRIER, INC.",
"associated_phone_numbers": [
"+12065551212"
],
"admin": {
"name": "John Doe",
"billing_phone_number": "+12065551212",
"account_number": "1234567890",
"authorized_person_name": "John Doe"
},
"address": {
"administrative_area": "NY",
"locality": "New York",
"postal_code": "10001",
"street_address": "123 Main St",
"full_address": "123 Main St; New York; NY; 10001"
}
},
"webhook_url": "https://example.com/webhook",
"record_type": "customer_service_record",
"created_at": "2021-03-19T10:07:15.527Z",
"updated_at": "2021-03-19T10:07:15.527Z"
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}{
"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"
}
}
]
}