Get calling settings for a phone number
GET
/
whatsapp
/
phone_numbers
/
{phone_number}
/
calling_settings
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const callingSetting = await client.whatsapp.phoneNumbers.callingSettings.retrieve('phone_number');
console.log(callingSetting.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
)
calling_setting = client.whatsapp.phone_numbers.calling_settings.retrieve(
"phone_number",
)
print(calling_setting.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"),
)
callingSetting, err := client.Whatsapp.PhoneNumbers.CallingSettings.Get(context.TODO(), "phone_number")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", callingSetting.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.whatsapp.phonenumbers.callingsettings.CallingSettingRetrieveParams;
import com.telnyx.sdk.models.whatsapp.phonenumbers.callingsettings.CallingSettingRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CallingSettingRetrieveResponse callingSetting = client.whatsapp().phoneNumbers().callingSettings().retrieve("phone_number");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
calling_setting = telnyx.whatsapp.phone_numbers.calling_settings.retrieve("phone_number")
puts(calling_setting)<?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 {
$callingSetting = $client->whatsapp->phoneNumbers->callingSettings->retrieve(
'phone_number'
);
var_dump($callingSetting);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx whatsapp:phone-numbers:calling-settings retrieve \
--api-key 'My API Key' \
--phone-number phone_numbercurl --request GET \
--url https://api.telnyx.com/v2/whatsapp/phone_numbers/{phone_number}/calling_settings \
--header 'Authorization: Bearer <token>'{
"data": {
"record_type": "whatsapp_calling_settings",
"phone_number": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"enabled": true
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}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 callingSetting = await client.whatsapp.phoneNumbers.callingSettings.retrieve('phone_number');
console.log(callingSetting.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
)
calling_setting = client.whatsapp.phone_numbers.calling_settings.retrieve(
"phone_number",
)
print(calling_setting.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"),
)
callingSetting, err := client.Whatsapp.PhoneNumbers.CallingSettings.Get(context.TODO(), "phone_number")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", callingSetting.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.whatsapp.phonenumbers.callingsettings.CallingSettingRetrieveParams;
import com.telnyx.sdk.models.whatsapp.phonenumbers.callingsettings.CallingSettingRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
CallingSettingRetrieveResponse callingSetting = client.whatsapp().phoneNumbers().callingSettings().retrieve("phone_number");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
calling_setting = telnyx.whatsapp.phone_numbers.calling_settings.retrieve("phone_number")
puts(calling_setting)<?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 {
$callingSetting = $client->whatsapp->phoneNumbers->callingSettings->retrieve(
'phone_number'
);
var_dump($callingSetting);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx whatsapp:phone-numbers:calling-settings retrieve \
--api-key 'My API Key' \
--phone-number phone_numbercurl --request GET \
--url https://api.telnyx.com/v2/whatsapp/phone_numbers/{phone_number}/calling_settings \
--header 'Authorization: Bearer <token>'{
"data": {
"record_type": "whatsapp_calling_settings",
"phone_number": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"enabled": true
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}