本書は ULIZA IP Broadcaster (Cloud) が提供する API 仕様について記述しています。ULIZA IP Broadcaster (Cloud) の機能や管理画面の操作方法については ULIZA IP Broadcaster (Cloud) ユーザーガイド を参照してください。
なお、本書に掲載しているコードサンプル(Request samples)は、具体的な実装例を示すことで開発者を支援することを目的としていますが、掲載しているコードがすべての環境において正常に動作することを保証するものではありません。また、コードサンプル内で使用している関数やライブラリの安全性に関して、弊社は何ら責任を負うものではありません。
注意
本書に記述している API を利用するには、対応するオプション(「ULIZA EVENT STREAM - マルチ WebAPI オプション」など)のご契約が必要となります。詳細については お問い合わせ ください。
バージョン | 改版日 | 改版内容 |
---|---|---|
v1.0.0 | 2020/10/19 | 初版 |
v1.1.0 | 2021/6/7 |
|
v1.2.0 | 2021/7/14 |
|
v1.3.0 | 2021/10/27 |
|
v1.3.1 | 2022/1/31 | ライブイベントのラベルとカテゴリに関する説明を追加 |
v1.4.0 | 2022/6/1 |
|
v1.5.0 | 2023/1/10 | ライブイベントの streamStatus 属性に ip (ライブエンコーダーの IP アドレス) と ua (ライブエンコーダーのユーザーエージェント)、source (採用されている入力) を追加 |
v1.6.0 | 2023/3/20 |
|
v1.6.1 | 2023/11/27 |
|
特に断りのない限り、本書に記載されている全ての API に対するリクエストの Authorization ヘッダに下記の形式で有効な API 認証キーを含める必要があります。API 認証キーの取得方法については ULIZA プロダクトアカウントユーザーガイド を参照してください。リクエストに有効な API 認証キーが含まれていない場合は、401 Unauthorized が返却されます。
Authorization: Bearer <api-credential>
ライブイベントに関する情報を取得します。
Array of objects |
curl \ -H 'Authorization: Bearer <your-token>' \ 'https://ipb-api.p.uliza.jp/v1/live'
{- "data": [
- {
- "accountid": "admin@play",
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "ライブイベント1",
- "description": "ライブイベントの説明です。",
- "archive": "same",
- "archived": "completed",
- "enableTranscode": true,
- "dvr": true,
- "segmentDuration": 6,
- "prioritizeInputPrimary": true,
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "bitrate": 1000000,
- "width": 1280,
- "height": 720
}
], - "status": "stopped",
- "category": "11111111-1111-1111-1111-111111111111",
- "labels": [
- "11111111-1111-1111-1111-111111111111"
], - "distributionId": "11111111-1111-1111-1111-111111111111",
- "distributionDomain": "example.com",
- "vms": {
- "name": "content-2021-01-01-00-00-00-111-11111111",
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "stream1"
}
], - "stream_sets": [
- {
- "name": "stream-set-2021-01-01-00-00-00-111-11111111"
}
], - "posters": [
- "11111111-1111-1111-1111-111111111111"
], - "subtitles": [
- "11111111-1111-1111-1111-111111111111"
]
}, - "archiVms": {
- "name": "content-2021-01-01-00-00-00-111-11111111",
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "stream1"
}
], - "stream_sets": [
- {
- "name": "stream-set-2021-01-01-00-00-00-111-11111111"
}
], - "posters": [
- "11111111-1111-1111-1111-111111111111"
], - "subtitles": [
- "11111111-1111-1111-1111-111111111111"
]
}, - "ingestUrl": {
- "domainRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/live",
- "domainPrimaryRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/primary",
- "domainBackupRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/backup",
- "rtmpUrl": "rtmp://0.0.0.0/live",
- "streamKey": [
- "11111111-1111-1111-1111-111111111111_1000000"
]
}, - "domainName": "11111111-1111-1111-1111-111111111111",
- "ip": "0.0.0.0",
- "pauseCount": 2,
- "cleardat": [
- 1609426800000,
- 1609513200000
], - "createdat": 1609426800000,
- "startingat": 1609426800000,
- "startedat": 1609426800000,
- "stoppedat": 1609426800000,
- "updatedat": 1609426800000,
- "expiredat": 1609426800000,
- "archivedat": 1609426800000
}
]
}
ライブイベントを作成します。
name required | string <= 200 characters ライブイベントの名前 |
description | string <= 5000 characters ライブイベントの説明 |
dvr | boolean DVRの有無 |
archive required | string Enum: "same" "another" "none" アーカイブ処理の種類
|
enableTranscode | boolean Default: false トランスコード機能の有効/無効 |
required | Array of objects [ 1 .. 3 ] items ストリーム情報 |
segmentDuration | number >= 1 Default: 4 HLSセグメント秒数 |
prioritizeInputPrimary | boolean Default: false 入力冗長化構成が行われたライブ配信での、接続や切断時の振る舞い。プライマリーとバックアップの両方が入力されている場合はプライマリーを配信します。 |
category required | string <uuid> ULIZA VMS (Cloud) に登録するカテゴリーID。カテゴリの取得についてはULIZA VMS (Cloud) API 仕様書を参照ください。 |
labels | Array of strings <uuid> unique ULIZA VMS (Cloud) に登録するラベルID。ラベルの取得についてはULIZA VMS (Cloud) API 仕様書を参照ください。 |
id | string ライブイベントID |
object 作成したライブイベント |
{- "name": "ライブイベント1",
- "description": "ライブイベントの説明です。",
- "dvr": true,
- "archive": "same",
- "enableTranscode": true,
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "bitrate": 1000000,
- "width": 1280,
- "height": 720
}
], - "segmentDuration": 6,
- "prioritizeInputPrimary": true,
- "category": "11111111-1111-1111-1111-111111111111",
- "labels": [
- "11111111-1111-1111-1111-111111111111"
]
}
{- "id": "11111111-1111-1111-1111-111111111111",
- "item": {
- "accountid": "admin@play",
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "ライブイベント1",
- "description": "ライブイベントの説明です。",
- "archive": "same",
- "archived": "completed",
- "enableTranscode": true,
- "dvr": true,
- "segmentDuration": 6,
- "prioritizeInputPrimary": true,
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "bitrate": 1000000,
- "width": 1280,
- "height": 720
}
], - "status": "stopped",
- "category": "11111111-1111-1111-1111-111111111111",
- "labels": [
- "11111111-1111-1111-1111-111111111111"
], - "distributionId": "11111111-1111-1111-1111-111111111111",
- "distributionDomain": "example.com",
- "vms": {
- "name": "content-2021-01-01-00-00-00-111-11111111",
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "stream1"
}
], - "stream_sets": [
- {
- "name": "stream-set-2021-01-01-00-00-00-111-11111111"
}
], - "posters": [
- "11111111-1111-1111-1111-111111111111"
], - "subtitles": [
- "11111111-1111-1111-1111-111111111111"
]
}, - "archiVms": {
- "name": "content-2021-01-01-00-00-00-111-11111111",
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "stream1"
}
], - "stream_sets": [
- {
- "name": "stream-set-2021-01-01-00-00-00-111-11111111"
}
], - "posters": [
- "11111111-1111-1111-1111-111111111111"
], - "subtitles": [
- "11111111-1111-1111-1111-111111111111"
]
}, - "ingestUrl": {
- "domainRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/live",
- "domainPrimaryRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/primary",
- "domainBackupRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/backup",
- "rtmpUrl": "rtmp://0.0.0.0/live",
- "streamKey": [
- "11111111-1111-1111-1111-111111111111_1000000"
]
}, - "domainName": "11111111-1111-1111-1111-111111111111",
- "ip": "0.0.0.0",
- "pauseCount": 2,
- "cleardat": [
- 1609426800000,
- 1609513200000
], - "createdat": 1609426800000,
- "startingat": 1609426800000,
- "startedat": 1609426800000,
- "stoppedat": 1609426800000,
- "updatedat": 1609426800000,
- "expiredat": 1609426800000,
- "archivedat": 1609426800000
}
}
ライブイベントに関する情報を取得します。
live_id required | string <UUID> ライブイベント ID |
object ライブイベント |
curl \ -H 'Authorization: Bearer <your-token>' \ 'https://ipb-api.p.uliza.jp/v1/live'
{- "data": {
- "accountid": "admin@play",
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "ライブイベント1",
- "description": "ライブイベントの説明です。",
- "archive": "same",
- "archived": "completed",
- "enableTranscode": true,
- "dvr": true,
- "segmentDuration": 6,
- "prioritizeInputPrimary": true,
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "bitrate": 1000000,
- "width": 1280,
- "height": 720
}
], - "status": "stopped",
- "category": "11111111-1111-1111-1111-111111111111",
- "labels": [
- "11111111-1111-1111-1111-111111111111"
], - "distributionId": "11111111-1111-1111-1111-111111111111",
- "distributionDomain": "example.com",
- "vms": {
- "name": "content-2021-01-01-00-00-00-111-11111111",
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "stream1"
}
], - "stream_sets": [
- {
- "name": "stream-set-2021-01-01-00-00-00-111-11111111"
}
], - "posters": [
- "11111111-1111-1111-1111-111111111111"
], - "subtitles": [
- "11111111-1111-1111-1111-111111111111"
]
}, - "archiVms": {
- "name": "content-2021-01-01-00-00-00-111-11111111",
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "stream1"
}
], - "stream_sets": [
- {
- "name": "stream-set-2021-01-01-00-00-00-111-11111111"
}
], - "posters": [
- "11111111-1111-1111-1111-111111111111"
], - "subtitles": [
- "11111111-1111-1111-1111-111111111111"
]
}, - "ingestUrl": {
- "domainRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/live",
- "domainPrimaryRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/primary",
- "domainBackupRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/backup",
- "rtmpUrl": "rtmp://0.0.0.0/live",
- "streamKey": [
- "11111111-1111-1111-1111-111111111111_1000000"
]
}, - "domainName": "11111111-1111-1111-1111-111111111111",
- "ip": "0.0.0.0",
- "pauseCount": 2,
- "cleardat": [
- 1609426800000,
- 1609513200000
], - "createdat": 1609426800000,
- "startingat": 1609426800000,
- "startedat": 1609426800000,
- "stoppedat": 1609426800000,
- "updatedat": 1609426800000,
- "expiredat": 1609426800000,
- "archivedat": 1609426800000,
- "streamStatus": {
- "property1": [
- {
- "status": "publish",
- "ip": "203.0.113.1",
- "ua": "FMLE/3.0 (compatible; FMSc/1.0)",
- "source": "primary",
- "updatedat": 1609426800000
}
], - "property2": [
- {
- "status": "publish",
- "ip": "203.0.113.1",
- "ua": "FMLE/3.0 (compatible; FMSc/1.0)",
- "source": "primary",
- "updatedat": 1609426800000
}
]
}
}
}
ライブイベントを更新します。リクエストボディに含めなかったパラメーターは更新されません。
status
が created
以外の場合は、400 BadRequest が返却されます。live_id required | string <UUID> ライブイベント ID |
name | string <= 200 characters ライブイベントの名前 |
description | string <= 5000 characters ライブイベントの説明 |
dvr | boolean DVRの有無 |
archive | string Enum: "same" "another" "none" アーカイブ処理の種類
|
enableTranscode | boolean Default: false トランスコード機能の有効/無効 |
Array of objects [ 1 .. 3 ] items ストリーム情報 | |
segmentDuration | number >= 1 Default: 4 HLSセグメント秒数 |
prioritizeInputPrimary | boolean Default: false 入力冗長化構成が行われたライブ配信での、接続や切断時の振る舞い。プライマリーとバックアップの両方が入力されている場合はプライマリーを配信します。 |
category | string <uuid> ULIZA VMS (Cloud) に登録するカテゴリーID。カテゴリの取得についてはULIZA VMS (Cloud) API 仕様書を参照ください。 |
labels | Array of strings <uuid> unique ULIZA VMS (Cloud) に登録するラベルID。ラベルの取得についてはULIZA VMS (Cloud) API 仕様書を参照ください。 |
id | string ライブイベントID |
object 更新したライブイベント |
{- "name": "ライブイベント1",
- "description": "ライブイベントの説明です。",
- "dvr": true,
- "archive": "same",
- "enableTranscode": true,
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "bitrate": 1000000,
- "width": 1280,
- "height": 720
}
], - "segmentDuration": 6,
- "prioritizeInputPrimary": true,
- "category": "11111111-1111-1111-1111-111111111111",
- "labels": [
- "11111111-1111-1111-1111-111111111111"
]
}
{- "id": "11111111-1111-1111-1111-111111111111",
- "item": {
- "accountid": "admin@play",
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "ライブイベント1",
- "description": "ライブイベントの説明です。",
- "archive": "same",
- "archived": "completed",
- "enableTranscode": true,
- "dvr": true,
- "segmentDuration": 6,
- "prioritizeInputPrimary": true,
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "bitrate": 1000000,
- "width": 1280,
- "height": 720
}
], - "status": "stopped",
- "category": "11111111-1111-1111-1111-111111111111",
- "labels": [
- "11111111-1111-1111-1111-111111111111"
], - "distributionId": "11111111-1111-1111-1111-111111111111",
- "distributionDomain": "example.com",
- "vms": {
- "name": "content-2021-01-01-00-00-00-111-11111111",
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "stream1"
}
], - "stream_sets": [
- {
- "name": "stream-set-2021-01-01-00-00-00-111-11111111"
}
], - "posters": [
- "11111111-1111-1111-1111-111111111111"
], - "subtitles": [
- "11111111-1111-1111-1111-111111111111"
]
}, - "archiVms": {
- "name": "content-2021-01-01-00-00-00-111-11111111",
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "stream1"
}
], - "stream_sets": [
- {
- "name": "stream-set-2021-01-01-00-00-00-111-11111111"
}
], - "posters": [
- "11111111-1111-1111-1111-111111111111"
], - "subtitles": [
- "11111111-1111-1111-1111-111111111111"
]
}, - "ingestUrl": {
- "domainRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/live",
- "domainPrimaryRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/primary",
- "domainBackupRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/backup",
- "rtmpUrl": "rtmp://0.0.0.0/live",
- "streamKey": [
- "11111111-1111-1111-1111-111111111111_1000000"
]
}, - "domainName": "11111111-1111-1111-1111-111111111111",
- "ip": "0.0.0.0",
- "pauseCount": 2,
- "cleardat": [
- 1609426800000,
- 1609513200000
], - "createdat": 1609426800000,
- "startingat": 1609426800000,
- "startedat": 1609426800000,
- "stoppedat": 1609426800000,
- "updatedat": 1609426800000,
- "expiredat": 1609426800000,
- "archivedat": 1609426800000
}
}
指定したライブイベントを削除します。
status
が created
以外の場合は、400 BadRequest が返却されます。live_id required | string <UUID> ライブイベント ID |
curl \ -X DELETE \ -H 'Authorization: Bearer <your-token>' \ 'https://ipb-api.p.uliza.jp/v1/live/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
{- "code": "INVALID_REQUEST",
- "message": "Bad request"
}
指定したライブイベントの開始指示をします。ライブイベントが実行中になるまでには数分かかる場合があります。
status
が created
以外の場合は、400 BadRequest が返却されます。live_id required | string <UUID> ライブイベント ID |
curl \ -H 'Authorization: Bearer <your-token>' \ -d '@request.json' \ 'https://ipb-api.p.uliza.jp/v1/live/11111111-1111-1111-1111-111111111111/start'
{- "code": "INVALID_REQUEST",
- "message": "Bad request"
}
指定したライブイベントを終了します。
status
が started
以外の場合は、400 BadRequest が返却されます。live_id required | string <UUID> ライブイベント ID |
pause | boolean Default: false 一時停止するかを示すフラグ。 |
id | string ライブイベントID |
object 一時停止されたライブイベント(一時停止のときのみ返却されます) |
{- "pause": true
}
{- "id": "11111111-1111-1111-1111-111111111111",
- "paused": {
- "id": "11111111-1111-1111-1111-111111111111",
- "item": {
- "accountid": "admin@play",
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "ライブイベント1",
- "description": "ライブイベントの説明です。",
- "archive": "same",
- "archived": "completed",
- "enableTranscode": true,
- "dvr": true,
- "segmentDuration": 6,
- "prioritizeInputPrimary": true,
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "bitrate": 1000000,
- "width": 1280,
- "height": 720
}
], - "status": "stopped",
- "category": "11111111-1111-1111-1111-111111111111",
- "labels": [
- "11111111-1111-1111-1111-111111111111"
], - "distributionId": "11111111-1111-1111-1111-111111111111",
- "distributionDomain": "example.com",
- "vms": {
- "name": "content-2021-01-01-00-00-00-111-11111111",
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "stream1"
}
], - "stream_sets": [
- {
- "name": "stream-set-2021-01-01-00-00-00-111-11111111"
}
], - "posters": [
- "11111111-1111-1111-1111-111111111111"
], - "subtitles": [
- "11111111-1111-1111-1111-111111111111"
]
}, - "archiVms": {
- "name": "content-2021-01-01-00-00-00-111-11111111",
- "streams": [
- {
- "id": "11111111-1111-1111-1111-111111111111",
- "name": "stream1"
}
], - "stream_sets": [
- {
- "name": "stream-set-2021-01-01-00-00-00-111-11111111"
}
], - "posters": [
- "11111111-1111-1111-1111-111111111111"
], - "subtitles": [
- "11111111-1111-1111-1111-111111111111"
]
}, - "ingestUrl": {
- "domainRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/live",
- "domainPrimaryRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/primary",
- "domainBackupRtmpUrl": "rtmp://11111111-1111-1111-1111-111111111111/backup",
- "rtmpUrl": "rtmp://0.0.0.0/live",
- "streamKey": [
- "11111111-1111-1111-1111-111111111111_1000000"
]
}, - "domainName": "11111111-1111-1111-1111-111111111111",
- "ip": "0.0.0.0",
- "pauseCount": 2,
- "cleardat": [
- 1609426800000,
- 1609513200000
], - "createdat": 1609426800000,
- "startingat": 1609426800000,
- "startedat": 1609426800000,
- "stoppedat": 1609426800000,
- "updatedat": 1609426800000,
- "expiredat": 1609426800000,
- "archivedat": 1609426800000
}
}
}
指定したライブイベントのキャッシュの削除指示をします。キャッシュが完全に削除されるまでには数分かかる場合があります。
status
が started
以外の場合は、400 BadRequest が返却されます。live_id required | string <UUID> ライブイベント ID |
curl \ -H 'Authorization: Bearer <your-token>' \ -d '@request.json' \ 'https://ipb-api.p.uliza.jp/v1/live/11111111-1111-1111-1111-111111111111/clear'
{- "code": "INVALID_REQUEST",
- "message": "Bad request"
}
クエリパラメーター「start」「end」で指定した期間のライブイベントの一覧と統計情報を取得します。
auth:GET:accounts
権限を持っている場合は、サブアカウントを含むレポートを取得します。start required | string^[0-9]+$ レポート取得期間の開始日時(ミリ秒単位のUNIX時間) |
end required | string^[0-9]+$ レポート取得期間の終了日時(ミリ秒単位のUNIX時間) |
object |
curl \ -H 'Authorization: Bearer <your-token>' \ 'https://ipb-api.p.uliza.jp/v1/report?start=1609426800000&end=1617202799999'
{- "data": {
- "organization": "string",
- "accounts": [
- {
- "account": "string",
- "count": 0,
- "totalTime": 0,
- "maxParallelLiveEventCount": 0,
- "items": null
}
]
}
}
すべてのエラーレスポンスにはエラーの種類を示すエラーコードが与えられます。返却されうるエラーコードの一覧とそれぞれの意味は下表の通りです。
エラーコード | 原因となる操作 | 意味 |
---|---|---|
INVALID_REQUEST |
すべての操作 | 不正なリクエスト形式 |
RESOURCE_NOT_FOUND |
すべての操作 | 指定したリソースが見つからない |
RESOURCE_ALREADY_EXISTS |
すべての操作 | 指定したリソースが既に存在している |
UNPROCESSABLE_STATUS |
すべての操作 | そのライブイベントのステータスでは指定した操作ができない |
OVER_SERVICE_LIMIT |
すべての操作 | サービス利用制限を超過している |
OVER_STORAGE_LIMIT |
ライブイベントの開始 | ストレージの使用可能容量を超過している |
REQUEST_UNAUTHORIZED |
すべての操作 | 認証エラーまたは認可されていないリクエスト |
UNKNOWN_ERROR |
すべての操作 | サーバ内部エラー |