会議リッスンの開始
POSThttps://{API_ENDPOINT}/v1/Accounts/{AccountSid}/Conferences/{ConferenceName}/listenContent-Type: application/json
会議のミックス音声 (L16 PCM) を指定した WebSocket URL へストリーミングします。会議名で指定するため、参加者の通話レグは不要です。このフォークはメディアサーバーが所有するものです。参加者数には含まれず、ルームを維持し続けることもなく、会議の終了時に自動的に破棄されます。すでにフォークが存在する会議に対してフォークを開始する操作は冪等であり、既存のボットメンバーを返します (201 ではなく 200)。
認証
Authorizationヘッダー (ベアラートークン, 必須) —Bearer <token>形式のベアラー認証です。token にはご自身の認証トークンを指定します。
リクエスト
パスパラメータ
AccountSidstringConferenceNamestring
ボディ (application/json)
このエンドポイントはオブジェクトを受け取ります。
urlstringメディアサーバーがルームのミックス音声をストリーミングする先の ws(s):// URLsampleRateintegerフォークの PCM サンプルレート (例: 8000、16000)wsAuthws_authWebSocket 接続時に提示する HTTP Basic 認証の資格情報metadataobjectフォークの最初のテキストフレームとしてそのまま配信される任意の JSON。受信側の WebSocket が自身を識別し設定するために使用できます
レスポンス
200
この会議にはすでにアクティブなリッスンフォークが存在します (冪等)
botMemberIdintegerbotIdstring
201
リッスンフォークを開始しました
botMemberIdintegerフォークボットの会議メンバー IDbotIdstring
エラー
400 Bad Request Error
url は必須です
any
404 Not Found Error
該当する会議がありません
any
502 Bad Gateway Error
会議をホストしているメディアサーバーが不明であるか、到達できません
any
型定義
ws_auth
WebSocket 接続時に提示する HTTP Basic 認証の資格情報
usernamestringpasswordstring
例
例 1
リクエスト
{
"url": "wss://audio-streaming.example.com/conference123/mix"
}
レスポンス
{
"botMemberId": 42,
"botId": "bot-7f3a9c2d"
}
cURL
curl -X POST "https://{API_ENDPOINT}/v1/Accounts/AccountSid/Conferences/ConferenceName/listen" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"url": "wss://audio-streaming.example.com/conference123/mix"
}'
Python
import requests
url = "https://{API_ENDPOINT}/v1/Accounts/AccountSid/Conferences/ConferenceName/listen"
payload = { "url": "wss://audio-streaming.example.com/conference123/mix" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
JavaScript
const url = 'https://{API_ENDPOINT}/v1/Accounts/AccountSid/Conferences/ConferenceName/listen';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: '{"url":"wss://audio-streaming.example.com/conference123/mix"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
リクエスト
{
"url": "wss://audio-streaming.example.com/conference123/mix"
}
レスポンス
{
"botMemberId": 42,
"botId": "bot-7f3a9c2d"
}
cURL
curl -X POST "https://{API_ENDPOINT}/v1/Accounts/AccountSid/Conferences/ConferenceName/listen" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"url": "wss://audio-streaming.example.com/conference123/mix"
}'
Python
import requests
url = "https://{API_ENDPOINT}/v1/Accounts/AccountSid/Conferences/ConferenceName/listen"
payload = { "url": "wss://audio-streaming.example.com/conference123/mix" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
JavaScript
const url = 'https://{API_ENDPOINT}/v1/Accounts/AccountSid/Conferences/ConferenceName/listen';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: '{"url":"wss://audio-streaming.example.com/conference123/mix"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}