Classic/VPC環境で利用できます。
同時配信チャンネルを作成します。
リクエスト
リクエスト形式を説明します。リクエスト形式は次の通りです。
| メソッド | URI |
|---|---|
| POST | /api/v2/re-stream/channels |
リクエストヘッダ
Live Station APIで共通して使用されるヘッダの詳細は、Live Stationのリクエストヘッダをご参照ください。
リクエストボディ
リクエストボディの説明は次の通りです。
| フィールド | タイプ | 必須の有無 | 説明 |
|---|---|---|---|
channelName |
String | Required | チャンネル名
|
planType |
String | Required | 料金プランタイプ
|
envType |
String | Optional | チャンネルタイプ
|
restream |
Array | Required | 同時配信プラットフォームリスト: restream |
restream
restreamの説明は次の通りです。
| フィールド | タイプ | 必須の有無 | 説明 |
|---|---|---|---|
targetName |
String | Required | 同時配信プラットフォーム名
|
rtmpUrl |
String | Required | 同時配信プラットフォーム RTMP URL |
streamKey |
String | Required | 同時配信プラットフォームのストリームキー |
id |
String | Optional | RTMP認証 ID
|
password |
String | Optional | RTMP認証パスワード
|
リクエスト例
リクエストのサンプルコードは次の通りです。
curl --location --request POST 'https://livestation.apigw.ntruss.com/api/v2/re-stream/channels' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'Content-Type: application/json' \
--header 'x-ncp-region_code: KR' \
--data '{
"channelName": "channel001",
"planType": "STANDARD",
"envType": "REAL",
"restream": [
{
"targetName": "YOUTUBE",
"rtmpUrl": "rtmp://rtmp-test.youtube.com",
"streamKey": "****-****-****-****-****",
"id": "user000",
"password": "dbwj@@@123"
},
{
"targetName": "PRISM",
"rtmpUrl": "rtmp://abc.com",
"streamKey": "****-****-****-****-****",
"id": "user001",
"password": "dbwj@@!456"
}
]
}'
レスポンス
レスポンス形式を説明します。
レスポンスボディ
レスポンスボディの説明は次の通りです。
| フィールド | タイプ | 必須の有無 | 説明 |
|---|---|---|---|
content |
Object | - | レスポンス結果 |
content.channelId |
String | - | チャンネル ID |
content.channelName |
String | - | チャンネル名 |
content.instanceNo |
Integer | - | チャンネルインスタンス番号 |
content.channelStatus |
String | - | チャンネルの状態
|
content.streamKey |
String | - | ストリームキー |
content.publishUrl |
String | - | 基本配信 URL |
content.planType |
String | - | 料金プランタイプ
|
content.createdTime |
Integer | - | チャンネル作成日時(ミリ秒)
|
content.restream |
Array | - | 同時配信プラットフォーム情報: restream |
content.platformCount |
Integer | - | 同時配信プラットフォーム数 |
content.totalPublishSeconds |
Integer | - | チャンネルの使用時間(秒) |
content.alertOn |
Boolean | - | イベントアラームを設定するか
|
content.isPublishing |
Boolean | - | 配信中か
|
content.envType |
String | - | チャンネルタイプ
|
restream
restreamの説明は次の通りです。
| フィールド | タイプ | 必須の有無 | 説明 |
|---|---|---|---|
id |
String | - | RTMP認証 ID
|
rtmpUrl |
String | - | 同時配信プラットフォーム RTMP URL |
streamKey |
String | - | 同時配信プラットフォームのストリームキー |
password |
String | - | RTMP認証パスワード
|
targetName |
String | - | 同時配信プラットフォーム名 |
レスポンスステータスコード
Live Station APIで共通して使用されるレスポンスステータスコードの詳細は、Live Stationのレスポンスステータスコードをご参照ください。
レスポンス例
レスポンスのサンプルコードは次の通りです。
{
"content": {
"channelId": "ls-20250819******-Ik1QU",
"channelName": "channel001",
"instanceNo": 1082*****,
"channelStatus": "READY",
"streamKey": "zg******************************",
"publishUrl": "rtmp://***********.video.media.ntruss.com:8080/relay",
"planType": "STANDARD",
"createdTime": 1755571786244,
"restream": [
{
"id": "user000",
"rtmpUrl": "rtmp://rtmp-test.youtube.com",
"streamKey": "****-****-****-****-****",
"password": "dbwj@@@123",
"targetName": "YOUTUBE"
},
{
"id": "user001",
"rtmpUrl": "rtmp://abc.prism.com",
"streamKey": "****-****-****-****-****",
"password": "dbwj@@!456",
"targetName": "PRISM"
}
],
"platformCount": 2,
"totalPublishSeconds": 0,
"alertOn": false,
"isPublishing": false,
"envType": "REAL"
}
}