Add an RCS agent test device
Adds an RCS-capable test number after provider agent creation. Repeating the request for a number already attached to the agent returns the existing test device.
POST
/
rcs
/
agents
/
{id}
/
test_devices
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const TestDevice = await client.rcs.agents.testDevices.create('id', {
phone_number: 'phone_number',
});
console.log(TestDevice.test_device_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
)
test_device = client.rcs.agents.test_devices.create(
id="id",
phone_number="phone_number",
)
print(test_device.test_device_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"),
)
testDevice, err := client.Rcs.Agents.TestDevices.New(
context.TODO(),
"id",
telnyx.RcAgentTestDeviceNewParams{
PhoneNumber: "phone_number",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", testDevice.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.rcs.agents.testDevices.TestDeviceCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TestDeviceCreateParams params = TestDeviceCreateParams.builder()
.phoneNumber("phone_number")
.build();
var response = client.rcs().agents().testDevices().create("id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
test_device = telnyx.rcs.agents.test_devices.create("id", phone_number: "phone_number")
puts(test_device)<?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 {
$test_device = $client->rcs->agents->testDevices->create(
'id',
phone_number: 'phone_number',
);
var_dump($test_device);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx rcs:agents:test-devices create \
--api-key 'My API Key' \
--id id \
--phone-number phone_numbercurl --request POST \
--url https://api.telnyx.com/v2/rcs/agents/{id}/test_devices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "+13125550123"
}
'{
"test_device_id": "44444444-4444-4444-8444-444444444444",
"phone_number": "+13125550123",
"invite_status": "ACCEPTED"
}{
"detail": "The requested RCS resource was not found."
}{
"detail": "The requested RCS resource was not found."
}{
"detail": "The requested RCS resource was not found."
}{
"detail": [
{
"loc": [
"body",
"display_name"
],
"msg": "Field required",
"type": "missing"
}
]
}{
"detail": "The requested RCS resource was not found."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The Telnyx-assigned agent identifier.
Body
application/json
Maximum string length:
16Pattern:
^\+[1-9][0-9]{1,14}$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 TestDevice = await client.rcs.agents.testDevices.create('id', {
phone_number: 'phone_number',
});
console.log(TestDevice.test_device_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
)
test_device = client.rcs.agents.test_devices.create(
id="id",
phone_number="phone_number",
)
print(test_device.test_device_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"),
)
testDevice, err := client.Rcs.Agents.TestDevices.New(
context.TODO(),
"id",
telnyx.RcAgentTestDeviceNewParams{
PhoneNumber: "phone_number",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", testDevice.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.rcs.agents.testDevices.TestDeviceCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TestDeviceCreateParams params = TestDeviceCreateParams.builder()
.phoneNumber("phone_number")
.build();
var response = client.rcs().agents().testDevices().create("id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
test_device = telnyx.rcs.agents.test_devices.create("id", phone_number: "phone_number")
puts(test_device)<?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 {
$test_device = $client->rcs->agents->testDevices->create(
'id',
phone_number: 'phone_number',
);
var_dump($test_device);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx rcs:agents:test-devices create \
--api-key 'My API Key' \
--id id \
--phone-number phone_numbercurl --request POST \
--url https://api.telnyx.com/v2/rcs/agents/{id}/test_devices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "+13125550123"
}
'{
"test_device_id": "44444444-4444-4444-8444-444444444444",
"phone_number": "+13125550123",
"invite_status": "ACCEPTED"
}{
"detail": "The requested RCS resource was not found."
}{
"detail": "The requested RCS resource was not found."
}{
"detail": "The requested RCS resource was not found."
}{
"detail": [
{
"loc": [
"body",
"display_name"
],
"msg": "Field required",
"type": "missing"
}
]
}{
"detail": "The requested RCS resource was not found."
}