Get Connection ID for a WhatsApp Calling BYON number
Retrieve the connection ID currently stored for a WhatsApp Calling BYON (Bring Your Own Number) phone number: the connection that inbound WhatsApp calls to the number are delivered to.
Use it to check the result of PATCH /whatsapp/phone_numbers/{id}/calling_routing. A read made immediately after an update can still return the previous value.
Sub-users need read permission on connections.
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 response of client.whatsapp.phoneNumbers.callingRouting.list()) {
console.log(response);
}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.whatsapp.phone_numbers.calling_routing.list(
"id",
)
print(page.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"),
)
callingRouting, err := client.Whatsapp.PhoneNumbers.CallingRouting.List(
context.TODO(),
"id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", callingRouting.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
var page = client.whatsapp().phoneNumbers().callingRouting().list("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.whatsapp.phone_numbers.calling_routing.list("id")
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->whatsapp->phoneNumbers->callingRouting->list(
'id',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx whatsapp:phone-numbers:calling-routing list \
--api-key 'My API Key' \
--id +13125550100curl --request GET \
--url https://api.telnyx.com/v2/whatsapp/phone_numbers/{id}/calling_routing \
--header 'Authorization: Bearer <token>'{
"data": {
"record_type": "whatsapp_calling_routing",
"phone_number": "+13125550100",
"connection_id": "1234567890"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The BYON phone number in E.164 format. The leading + is optional.
Response
The stored routing connection. connection_id is null when no connection is routed, and also when the stored target is not a connection in the account, including a connection too new to have propagated yet.
Show child attributes
Show child attributes
Was this page helpful?
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 response of client.whatsapp.phoneNumbers.callingRouting.list()) {
console.log(response);
}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.whatsapp.phone_numbers.calling_routing.list(
"id",
)
print(page.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"),
)
callingRouting, err := client.Whatsapp.PhoneNumbers.CallingRouting.List(
context.TODO(),
"id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", callingRouting.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
var page = client.whatsapp().phoneNumbers().callingRouting().list("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.whatsapp.phone_numbers.calling_routing.list("id")
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->whatsapp->phoneNumbers->callingRouting->list(
'id',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx whatsapp:phone-numbers:calling-routing list \
--api-key 'My API Key' \
--id +13125550100curl --request GET \
--url https://api.telnyx.com/v2/whatsapp/phone_numbers/{id}/calling_routing \
--header 'Authorization: Bearer <token>'{
"data": {
"record_type": "whatsapp_calling_routing",
"phone_number": "+13125550100",
"connection_id": "1234567890"
}
}