アプリケーション制御メッセージの送信
アプリケーションサーバーは、APIを利用してグループ通話(カンファレンス)の参加者にメッセージを送ることができます。
通話タイプ | SDKの最低バージョン | 対応するSDKイベント |
---|---|---|
グループ通話 |
|
|
メッセージを送る方法には、ブロードキャスト(broadcast)とマルチキャスト(multicast)の2種類があります。ブロードキャストは、参加者全員にメッセージを送ります。マルチキャストは、特定の参加者にメッセージを送ります。
ブロードキャスト
参加者全員にメッセージを送ります。
メソッドとエンドポイント
-
メソッド:POST
-
エンドポイント
/tas/v1/gcall/{serviceId}/{roomId}/data/broadcast
ヘッダー
- Authorization:
Basic {your credential}
- Content-Type: text/plain
パスパラメーター
パラメーター | 説明 |
---|---|
serviceId | サービスID |
roomId | ルームID |
リクエスト本文
- 形式:一般テキスト
- 本文の最大サイズ:3,072バイト
レスポンス
なし
例1
アプリサーバーが、参加者全員に"this is test control message."というメッセージを送る例です。この例で必要な値は、以下のように設定しました。
service-id
: ex-serviceroom-id
: ex-room
curl --location --request \
POST 'https://vpnx-stn-api.line-apps.com/tas/v1/gcall/ex-service/ex-room/data/broadcast' \
--header 'Authorization: Basic YWxhZGRpbjpvcGVuX3Nlc2FtZQ==' \
--header 'Content-Type: text/plain' \
--data-raw 'this is a test control message.'
例2
アプリサーバーが、参加者全員に独自定義したデータを送る例です。この例で必要な値は、以下のように設定しました。
service-id
: ex-serviceroom-id
: ex-room
curl --location --request \
POST 'https://vpnx-stn-api.line-apps.com/tas/v1/gcall/ex-service/ex-room/data/broadcast' \
--header 'Authorization: Basic YWxhZGRpbjpvcGVuX3Nlc2FtZQ==' \
--header 'Content-Type: text/plain' \
--data-raw '{
"title": "this is JSON format example",
"sent": 1617277417048
}'
発生し得るHTTPステータスコード
発生する可能性のあるHTTPステータスコードは、以下のとおりです。詳しくは、エラー処理を参照してください。
- 400、401、403、404、429、500、503
マルチキャスト
特定の参加者にメッセージを送ります。対象者のユーザーIDを指定する必要があります。
メソッドとエンドポイント
- メソッド:POST
- エンドポイント
/tas/v1/gcall/{serviceId}/{roomId}/data/multicast
ヘッダー
- Authorization:
Basic {your credential}
- Content-Type:text/plain
パスパラメーター
パラメーター | 説明 |
---|---|
serviceId | サービスID |
roomId | ルームID |
クエリパラメーター
パラメーター | データ型 | 形式 | 備考 |
---|---|---|---|
user_id | String | ユーザーIDをコン(,)でつなげた文字列。user-id-01,user-id-02,...,user-id-N | 最大100個 |
以下は、クエリパラメーターの例です。
{API URI}?user_id=user-01,user02,user-03
リクエスト本文
- 形式:一般テキスト
- 本文の最大サイズ:3,072バイト
サンプル
アプリサーバーがusr03とusr05に「this is test control message.」というメッセージを送ります。この例では必要な値を以下のように設定しています。
service-id
:ex-serviceroom-id
:ex-room
curl --location --request \
POST 'https://vpnx-stn-api.line-apps.com/tas/v1/gcall/ex-service/ex-room/data/multicast?user_id=usr03,usr05' \
--header 'Authorization: Basic YWxhZGRpbjpvcGVuX3Nlc2FtZQ==' \
--header 'Content-Type: text/plain' \
--data-raw 'this is test control message.'
発生し得るHTTPステータスコード
発生する可能性のあるHTTPステータスコードは、以下のとおりです。詳しくは、エラー処理を参照してください。
- 400、401、403、404、429、500、503