Get a customer service record
Get a specific customer service record.
GET
/
customer_service_records
/
{customer_service_record_id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const customerServiceRecord = await client.customerServiceRecords.retrieve(
'customer_service_record_id',
);
console.log(customerServiceRecord.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
)
customer_service_record = client.customer_service_records.retrieve(
"customer_service_record_id",
)
print(customer_service_record.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"),
)
customerServiceRecord, err := client.CustomerServiceRecords.Get(context.TODO(), "customer_service_record_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", customerServiceRecord.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.CustomerServiceRecordRetrieveParams;
import com.telnyx.sdk.models.customerservicerecords.CustomerServiceRecordRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CustomerServiceRecordRetrieveResponse customerServiceRecord = client.customerServiceRecords().retrieve("customer_service_record_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
customer_service_record = telnyx.customer_service_records.retrieve("customer_service_record_id")
puts(customer_service_record)<?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 {
$customerServiceRecord = $client->customerServiceRecords->retrieve(
'customer_service_record_id'
);
var_dump($customerServiceRecord);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx customer-service-records retrieve \
--api-key 'My API Key' \
--customer-service-record-id customer_service_record_idcurl --request GET \
--url https://api.telnyx.com/v2/customer_service_records/{customer_service_record_id} \
--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"
}
}{
"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": "10005",
"title": "Resource not found",
"detail": "The requested resource or URL could not be found.",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10005"
}
}
]
}{
"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"
}
}
]
}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 customerServiceRecord = await client.customerServiceRecords.retrieve(
'customer_service_record_id',
);
console.log(customerServiceRecord.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
)
customer_service_record = client.customer_service_records.retrieve(
"customer_service_record_id",
)
print(customer_service_record.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"),
)
customerServiceRecord, err := client.CustomerServiceRecords.Get(context.TODO(), "customer_service_record_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", customerServiceRecord.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.CustomerServiceRecordRetrieveParams;
import com.telnyx.sdk.models.customerservicerecords.CustomerServiceRecordRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CustomerServiceRecordRetrieveResponse customerServiceRecord = client.customerServiceRecords().retrieve("customer_service_record_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
customer_service_record = telnyx.customer_service_records.retrieve("customer_service_record_id")
puts(customer_service_record)<?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 {
$customerServiceRecord = $client->customerServiceRecords->retrieve(
'customer_service_record_id'
);
var_dump($customerServiceRecord);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx customer-service-records retrieve \
--api-key 'My API Key' \
--customer-service-record-id customer_service_record_idcurl --request GET \
--url https://api.telnyx.com/v2/customer_service_records/{customer_service_record_id} \
--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"
}
}{
"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": "10005",
"title": "Resource not found",
"detail": "The requested resource or URL could not be found.",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10005"
}
}
]
}{
"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"
}
}
]
}