Play audio to conference participants
Play audio to all or some participants on a conference call.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.conferences.actions.play('id');
console.log(response.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
)
response = client.conferences.actions.play(
id="id",
)
print(response.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"),
)
response, err := client.Conferences.Actions.Play(
context.TODO(),
"id",
telnyx.ConferenceActionPlayParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.conferences.actions.ActionPlayParams;
import com.telnyx.sdk.models.conferences.actions.ActionPlayResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ActionPlayResponse response = client.conferences().actions().play("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.conferences.actions.play("id")
puts(response)<?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 {
$response = $client->conferences->actions->play(
'id',
audioURL: 'http://www.example.com/sounds/greeting.wav',
callControlIDs: ['string'],
loop: 'infinity',
mediaName: 'my_media_uploaded_to_media_storage_api',
region: 'US',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx conferences:actions play \
--api-key 'My API Key' \
--id idcurl --request POST \
--url https://api.telnyx.com/v2/conferences/{id}/actions/play \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"audio_url": "http://www.example.com/sounds/greeting.wav"
}
'Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Uniquely identifies the conference by id or name
Body
The URL of a file to be played back in the conference. media_name and audio_url cannot be used together in one request.
"http://example.com/message.wav"
The media_name of a file to be played back in the conference. The media_name must point to a file previously uploaded to api.telnyx.com/v2/media by the same user/organization. The file must either be a WAV or MP3 file.
"my_media_uploaded_to_media_storage_api"
The number of times the audio file should be played. If supplied, the value must be an integer between 1 and 100, or the special string infinity for an endless loop.
"infinity"
List of call control ids identifying participants the audio file should be played to. If not given, the audio file will be played to the entire conference.
Region where the conference data is located. Defaults to the region defined in user's data locality settings (Europe or US).
Australia, Europe, Middle East, US "US"
Response
Successful response upon making a conference command.
Show child attributes
Show child attributes
{ "result": "ok" }
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
});
const response = await client.conferences.actions.play('id');
console.log(response.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
)
response = client.conferences.actions.play(
id="id",
)
print(response.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"),
)
response, err := client.Conferences.Actions.Play(
context.TODO(),
"id",
telnyx.ConferenceActionPlayParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.conferences.actions.ActionPlayParams;
import com.telnyx.sdk.models.conferences.actions.ActionPlayResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ActionPlayResponse response = client.conferences().actions().play("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.conferences.actions.play("id")
puts(response)<?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 {
$response = $client->conferences->actions->play(
'id',
audioURL: 'http://www.example.com/sounds/greeting.wav',
callControlIDs: ['string'],
loop: 'infinity',
mediaName: 'my_media_uploaded_to_media_storage_api',
region: 'US',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx conferences:actions play \
--api-key 'My API Key' \
--id idcurl --request POST \
--url https://api.telnyx.com/v2/conferences/{id}/actions/play \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"audio_url": "http://www.example.com/sounds/greeting.wav"
}
'