Callback Endpoint登録
- 印刷する
- PDF
Callback Endpoint登録
- 印刷する
- PDF
Article Summary
Share feedback
Thanks for sharing your feedback!
Live Stationで発生したイベントを受信できるCallback Endpointを登録するAPIです。
コールバックエンドポイントは、すべてのチャネルとチャネルごとに個別に設定できます。
リクエスト
Endpoint | Description |
---|---|
[POST https://livestation.apigw.ntruss.com/api/v2/events/callbackEndpoint] | デフォルトとしてのすべてのチャネルコールバック設定(N(チャネル):1(コールバックエンドポイント)) |
[POST https://livestation.apigw.ntruss.com/api/v2/channels/{channelId}/callbackEndpoint] | 各チャネルのコールバック設定(1(チャネル):1(コールバックエンドポイント)) |
[POST https://livestation.apigw.ntruss.com/api/v2/re-stream/channels/{channelId}/callbackEndpoint] | 各リストリームチャネルのコールバック設定(1(チャネル):1(コールバックエンドポイント)) |
リクエストごとのコールバックアクション
各チャネルのコールバックエンドポイント | すべてのチャネルのコールバックエンドポイント | アクション |
---|---|---|
Not set | Not set | コールバックは送信されません |
Not set | Set | コールバックはすべてのチャネルのコールバックエンドポイントに送信されます |
Set | Not set | コールバックは各チャネルのコールバックエンドポイントに送信されます |
Set | Set | コールバックは各チャネルのコールバックエンドポイントに送信されます |
リクエストヘッダ
ヘッダ名 | 必須可否 | 説明 |
---|---|---|
x-ncp-apigw-timestamp | YES | 1970年1月1日 00:00:00 協定世界時(UTC)からの経過時間をミリセカンド(Millisecond)で表し、API Gatewayサーバとの時間差が5分以上の場合は無効なリクエストとしてみなす。x-ncp-apigw-timestamp:{Timestamp} |
x-ncp-iam-access-key | YES | Naverクラウドプラットフォームポータルで発行されたAccess Key IDの値x-ncp-iam-access-key:{Sub Account Access Key} |
x-ncp-apigw-signature-v2 | YES | Access Key ID値とSecret Keyで暗号化した署名x-ncp-apigw-signature-v2:{API Gateway Signature} |
x-ncp-region_code | YES | リージョン·コード (KR) |
リクエストボディ
フィールド名 | 必須 | タイプ | 制約事項 | 説明 |
---|---|---|---|---|
callbackUrl | Yes | String | callbackを受けるcustom endpoint |
各チャネルのリクエスト本文
フィールド名 | 必須 | タイプ | 制約事項 | 説明 |
---|---|---|---|---|
callbackEndpoint | Yes | String | callbackを受けるcustom endpoint |
Callback送信データ
Callback endpoint を登録すると、Live Stationでイベントが発生するたびに設定されたendpoint URLに下記のような形態のデータが送信されます。(HTTP POST 使用)
{
"id": 1234,
"logLevel": "INFO",
"channelId": "ls-20200327140131-aBCD3",
"event": "STREAM_UPDATE",
"updateTime": 1599218791425
}
レスポンス
リストリームチャネルのコールバック設定応答本文
フィールド名 | タイプ | 説明 | 備考 |
---|---|---|---|
callbackUrl | String | ||
updateTime | Integer |
一般チャネルのコールバック設定応答本文
フィールド名 | タイプ | 説明 | 備考 |
---|---|---|---|
channelId | String | ||
channelName | String | ||
instanceNo | String | ||
qualitySetId | Integer | ||
qualitySetName | String | ||
outputProtocol | String | Default set: HLS, DASH | |
channelStatus | String | CREATING, READY, PUBLISH, DELETED | |
isRecording | Boolean | ||
useDvr | Boolean | ||
immediateOnAir | Boolean | true, false | |
timemachineMin | Integer | Unit: Minute | |
snapshot | Object | ||
snapshotId | Integer | ||
cdn | Object | ||
cdn.instanceNo | String | NO_CDNなら0 | |
cdn.serviceName | String | CDN Service Name | NO_CDNなら "" |
cdn.statusName | String | CDN 状態 | NO_CDNなら "" |
cdn.cdnType | String | CDN_PLUS, GLOBAL_CDN | |
cdn.cdnDomain | String | CDN Domain | NO_CDNなら "" |
record | Object | ||
record.format | String | MP4,HLS,ALL | |
record.type | String | NO_RECORD, AUTO_UPLOAD, MANUAL_UPLOAD | |
record.bucketName | String | ||
record.filePath | String | ||
record.acessControl | String | PRIVATE, PUBLIC_READ | |
publishUrl | String | ||
streamKey | String | ||
createdTime | Integer | ||
totalPublishSeconds | Integer | ||
alertOn | Boolean | if alertOn == true, alertOptions should be set | |
alertOptions | Object | ||
alertOptions.alertChangeStatus | Boolean | ||
alertOptions.alertVodUploadFail | Boolean | ||
alertOptions.alertReStreamFail | Boolean | ||
recentPublishStartTime | Integer | ||
envType | String | DEV, STAGE, REAL | |
callbackEndpoint | String |
リストリームチャネルのコールバック設定応答本文
フィールド名 | タイプ | 説明 | 備考 |
---|---|---|---|
channelId | String | ||
channelName | String | ||
instanceNo | Integer | ||
channelStatus | String | ||
createdTime | Integer | ||
publishUrl | String | ||
streamKey | String | ||
planType | String | STANDARD, PROFESSIONAL | |
restream | Object[] | ||
restream[].targetName | String | ||
restream[].rtmpUrl | String | ||
restream[].streamKey | String | ||
restream[].id | String | 設定されていれば表示 | |
restream[].password | String | 設定されていれば表示 | |
platformCount | Integer | ||
totalPublishSeconds | Integer | ||
recentPublishStartTime | Integer | ||
alertOn | Boolean | ||
alertOptions | Object | ||
alertOptions.alertChangeStatus | Boolean | ||
alertOptions.alertVodUploadFail | Boolean | ||
alertOptions.alertReStreamFail | Boolean | ||
isPublishing | Boolean | ||
envType | String | DEV, STAGE, REAL | |
callbackEndpoint | String |
例示
すべてのチャネルのリクエスト例
POST /api/v2/events/callbackEndpoint
HOST: livestation.apigw.ntruss.com
Content-Type: application/json
x-ncp-apigw-timestamp:1521787414578
x-ncp-iam-access-key:6uxz1nKkcYwUjWRG5Q1V7NsW0i5jErlu2NjBXXgy
x-ncp-apigw-signature-v2:iJFK773KH0WwQ79PasqJ+ZGixtpDQ/abS57WGQdld2M=
x-ncp-region_code:KR
{
"callbackUrl": "https://my-callback-endpoint"
}
すべてのチャネルの応答例
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 12 Sep 2018 09:53:32 GMT
Content-Type: application/json;charset=utf-8
Connection: keep-alive
Access-Control-Allow-Origin: *
x-ncp-trace-id: 36c9k60om4p3238cpmc9gm4cj4
{
"content": {
"callbackUrl": "https://my-callback-endpoint",
"updateTime": 1614751615488
}
}
各チャネルのリクエスト例
POST /api/v2/channels/{channelId}/callbackEndpoint
HOST: livestation.apigw.ntruss.com
Content-Type: application/json
x-ncp-apigw-timestamp:1521787414578
x-ncp-iam-access-key:6uxz1nKkcYwUjWRG5Q1V7NsW0i5jErlu2NjBXXgy
x-ncp-apigw-signature-v2:iJFK773KH0WwQ79PasqJ+ZGixtpDQ/abS57WGQdld2M=
x-ncp-region_code:KR
{
"callbackEndpoint": "https://my-callback-endpoint"
}
各チャネルの応答例
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 26 Sep 2021 09:53:32 GMT
Content-Type: application/json;charset=utf-8
Connection: keep-alive
Access-Control-Allow-Origin: *
x-ncp-trace-id: 36c9k60om4p3238cpmc9gm4cj4
{
"content" : {
"channelId" : "ls-20200323114720-bMoDF",
"channelName" : "mychannel",
"instanceNo" : 1163899,
"qualitySetId" : 6,
"qualitySetName" : "360p-set",
"outputProtocol" : "HLS, DASH",
"channelStatus" : "READY",
"isRecording" : false,
"useDVR" : true,
"immediateOnAir" : false,
"timemachineMin" : 360,
"cdn" : {
"instanceNo" : "1163900",
"serviceName" : "cdn-ls-20200323114720-bMoDF",
"statusName" : "running",
"cdnType" : "CDN_PLUS",
"cdnDomain" : "mycdn.cdn.ntruss.com"
},
"record": {
"type": "AUTO_UPLOAD",
"bucketName": "hls",
"filePath": "/livestation",
"format": "MP4",
"accessControl": "PRIVATE"
},
"publishUrl": "rtmp://live-station-rtmp-url",
"streamKey": "jjiantco4psakuwd5526u2glcxrqaar4",
"totalPublishSeconds" : 0,
"createdTime" : 1584931640000,
"recentPublishStartTime": 0,
"alertOn" : false,
"alertOptions" : {
"alertChangeStatus" : false,
"alertVodUploadFail" : false,
"alertReStreamFail" : false
},
"callbackEndpoint": "https://my-callback-endpoint",
"envType": "REAL"
}
}
各リストリームチャネルのリクエスト例
POST /api/v2/re-stream/channels/{channelId}/callbackEndpoint
HOST: livestation.apigw.ntruss.com
Content-Type: application/json
x-ncp-apigw-timestamp:1521787414578
x-ncp-iam-access-key:6uxz1nKkcYwUjWRG5Q1V7NsW0i5jErlu2NjBXXgy
x-ncp-apigw-signature-v2:iJFK773KH0WwQ79PasqJ+ZGixtpDQ/abS57WGQdld2M=
x-ncp-region_code:KR
{
"callbackEndpoint": "https://my-callback-endpoint"
}
各リストリームチャネルの応答例
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 26 Feb 2021 09:53:32 GMT
Content-Type: application/json;charset=utf-8
Connection: keep-alive
Access-Control-Allow-Origin: *
x-ncp-trace-id: 36c9k60om4p3238cpmc9gm4cj4
{
"content": {
"channelId": "ls-20210225185132-FxGSn",
"channelName": "mycallback-20210225185132",
"instanceNo": 1627140,
"channelStatus": "READY",
"streamKey": "7xtotpxpkjnyhmjbe7k7jaa952q6lmhl",
"publishUrl": "rtmp://live-station-rtmp-url",
"planType": "STANDARD",
"createdTime": 1614246692000,
"restream": [
{
"id": "itis",
"rtmpUrl": "rtmp://notworking-just-testcase.only",
"streamKey": "12345",
"password": "itispassword",
"targetName": "YOUTUBE"
}
],
"platformCount": 1,
"totalPublishSeconds": 0,
"alertOn": false,
"isPublishing": false,
"alertOptions": {
"alertChangeStatus": false,
"alertVodUploadFail": false,
"alertReStreamFail": false
},
"callbackEndpoint": "https://my-callback-endpoint",
"envType": "REAL"
}
}
エラーコード
Live Station APIリクエストが誤っているか、処理中にエラーが発生するとHTTPステータスコードで成功/失敗を返却し、JSON形式で詳細メッセージを返却します。
エラーコードはLive Station APIの'共通エラーコード'と'API Gatewayエラーコード'の2つです。
エラーコード | レスポンスメッセージ | 説明 |
---|---|---|
250000 | Unexpected error occurred. | エラーが発生しました。 |
250001 | {0} | エラーが発生しました。 |
250002 | {0}: invalid value. | リクエスト値のフォーマットが正しくありません。 |
250003 | Missing required header. | 必須要請ヘッダーが抜けました。 |
250004 | {0} not found. | リクエストリソースが見つかりません。 |
250005 | {0} not available. | リクエストリソースを使用できません。 |
250006 | Unauthorized {0}. | リクエストリソースに権限がありません。 |
250007 | {0} connection failed. | コネクション接続に失敗しました。 |
250008 | Request failed. | リクエストに失敗しました。 |
250009 | Third-party interface exception: {0}. | 内部エラーが発生しました。 |
250010 | We cannot accomplish the task as permissions are not granted for the sub account. Please modify permissions for the account through the Sub Account service. | Sub Account権限が十分ではありません。 |
250011 | {0} must has a valid value | 有効な値ではありません。 |
250012 | Invalid request data,please check | データが有効ではありません。 |
250013 | OK | |
250014 | Form validation failed | データが有効ではありません。 |
250015 | Access denied | 接近できません。 |
250016 | Server error | サーバエラーが発生しました。 |
250017 | Unauthorized | リクエストリソースに権限がありません。 |
250018 | Bad Request | 誤った要請です。 |
250019 | The Region {0} not support now. | 現在サポートしていないリージョンです。 |
250020 | Invalid region code {0}. | 無効なリージョンコードです。 |
250021 | Invalid parameter type.{0} can not convert to type {1}. | 無効なパラメ一夕タイプです。 |
250022 | The url that you specified is not invalid format. | URL の形式が正しくありません。 |
250100 | Channel is not found | チャンネルが見つかりません。 |
250101 | This channel is not publishing now | 現在送出中のチャンネルではありません。 |
250102 | This channel is publishing | 現在送出中のチャンネルです。 |
250103 | This channel has never been published. | 一度も送出されたことのないチャンネルです。 |
250104 | Channel names can be entered with a minimum of 3 characters and a maximum of 20 characters. Special character “_” allowed. | チャンネル名がLive Stationでサポートする形式ではありません。3文字以上20文字以下、"_"許容 |
250105 | Start publish failed | |
250106 | Stop publish failed | |
250107 | This channel's CDN is not running | このチャンネルのCDNが動作しません。 |
250108 | CDN secure token cannot set | |
250109 | If CDN status is creating or changing, channel cannot be deleted. | CDN状態が生成中または変更中であればチャンネルを削除できません。 |
250110 | Cannot create channel, reason: {0} | |
250111 | Wrong notification type | Notification タイプが正しくありません。 |
250112 | Cannot configure Notification | |
250113 | In order to return channel, CDN must be returned first. | |
250114 | Channel can be deleted only in 'READY' state. | READY状態のCHANNELのみ返却できます。 |
250115 | The channel didn't set DVR | DVR が設定されていないチャンネルです。 |
250116 | The request did not include the required "QualitySet" | |
250118 | The request did not include the required "CDN_TYPE" | |
250119 | The cdnInstanceNo is needed when createCdn is false. | |
250120 | The cdn type that you specified is not allowed: only "CDN_PLUS", "GCDN" is supported. | 対応していないCDNタイプです。"CDN_PLUS", "GCDN"のみ支援 |
250121 | The request channel did not set useDvr. | |
250122 | The timemachineMin should be 360. | timemachineMinは360分でのみ設定できます。 |
250123 | The specified channel Id does not exist. | 存在しないチャンネルIDです。 |
250124 | The request does not allowed: You can get url only cdn status is "RUNNING" | |
250125 | The request does not allowed: You can get url only channel status is "READY" | |
250126 | The number of professional type can not exceed 5 : targetPlatform is allowed between 1 and 5 | |
250127 | The plan type that you specified is not allowed. | |
250128 | The number of standard plan type can not exceed 3 : targetPlatform is allowed between 1 and 3 | |
250129 | The input of rtmp url that you specified is not allowed | |
250130 | The restream targetName value that you specified is not allowed : [STEAM, MIXER , TWITCH , YOUNOW , USTREAM , AFREECA_TV , NAVER_TV , V_LIVE, LINE_TV , PRISM, LIVESTATION, CUSTOM] ar e supported. | |
250131 | The channel value that you specified is not allowed. | |
250133 | The request channel did not set useDvr | |
250134 | The request channel status is no "PUBLISHING" | |
250135 | The request does not allowed : the recording has been start already | |
250136 | The request does not allowed : the recording has been start already | |
250137 | The request does not allowed : the recording status is not "TRUE" | |
250138 | The param timemacineMin is needed when useDvr is true. | |
250139 | The param immediateOnair should be false when useDvr is false. | |
250140 | Cdn status should be running when create channel. | |
250141 | You can get time machine url only recording status is TRUE. | |
250142 | ChannelName should not be null. | |
250143 | The request did not include the required "stream key". | |
250300 | Quality is not found. | |
250301 | The qualitySetId that you specified not found. | |
250302 | Quality set must have only one 1080p quality. | |
250303 | Delete system quality profile is not allowed. | |
250304 | Invalid user info. | |
250305 | System resource cannot update | Systemリソースはアップデートできません。 |
250306 | Resource is in use | 現在使用中のリソースです。 |
250307 | The segment duration value that you specified is not allowd (exceeds valid limit or wrong type) : valid value is allowed integer value between 1000 and 10000 in 500 units is supported. (unit : milliseconds ) | |
250309 | The segment count value that you specified is not allowed (exceeds valid limit or wrong type): valid value is allowed integer between 2 and 10 | |
250311 | Delete system quality set is not allowed. | Systemリソースは削除できません。 |
250312 | Only Alphabets, Numbers and Hypen are allowed. The length must be between 3 and 20 characters. | 英文、数字、"-"許容、3者以上20字 |
250313 | quality size error (min:1, max:4) | Qualityは最低1つ、最大4つまで設定することができます。 |
250314 | Video codec must have a value | |
250315 | Video codec profile must have a value | |
250316 | Video codec profile level must have a value | |
250321 | Video bitrate must be greater than or equal to 1 | |
250322 | Video bitrate must be less than or equal to 20000000 | |
250323 | Video B frames must be greater than or equal to 0 | |
250324 | Video B frames must be less than or equal to 4 | |
250325 | Audio codec must have a value | |
250327 | Audio sampling rate must have a value | |
250328 | Audio channels must have a value | |
250333 | {0} Profile only when AAC | |
250334 | bFrames only 0 is available if resolution less than 409920(854*480) | |
250335 | bFrames only 0,1,2 are available if resolution less than 921600 (1280*720) | |
250336 | Video frame rate must be greater than or equal to 1 | Videoframerateは1以上に設定する必要があります。 |
250337 | Video frame rate be less than or equal to 60 | Videoframerateは60以下に設定する必要があります。 |
250338 | Audio channels must be greater than or equal to 0 | オーディオチャンネルは0以上に設定する必要があります。 |
250339 | Audio channels must be less than or equal to 8 | オーディオチャンネルは8以下に設定する必要があります。 |
250341 | Only profile 'BASELINE' available for resolution less than 921600 (1280*720) | |
250342 | Only even integer are available for video width and height | |
250343 | Interval must bigger than 0 | Intervalは無条件で0より大きい必要があります。 |
250344 | Must input key | |
250345 | Must input header | |
250348 | The request did not set content-type to "application/json" | |
250351 | The timedmeta that you specified is not allowed: only integer "1000" is supported. | |
250353 | The audio codec that you specified is not allowed: only "AAC", "MP3" audio codec is supported. | |
250354 | The profile value of audio codec that you specified is not allowed: only profile LC is supported. | |
250355 | The audio channel value that you specified is not allowed: only audio channel value [0, 1,2,3,4,5,6,7,8] are supported | |
250356 | The audio channel value that you specified is not allowed: only audio channel value [0, 1, 2] are supported. | |
250357 | The audio bitrate value that you specified is not allowed(exceed valid limit or wrong type): valid value is allowed integer between 16 and 320. | |
250358 | The audio sampling rate that you specified is not allowed: only audio sampling rate value AAC: [8000, 11025, 12000, 16000, 22050, 24000,32000, 44100, 48000, 64000,88200,96000] are supported. | |
250359 | The audio sampling rate that you specified is not allowed: only audio sampling rate value MP3:[8000,11025, 12000,16000,22050,24000,32000,44100,48000] are supported. | |
250360 | The video codec that you specified is not allowed: only "H264" format is supported. | |
250361 | The profile of video codec that you specified is not allowed: only profile value [BASELINE, MAIN, HIGH] are supported. | |
250362 | The orientation of video that you specified is not allowed: only [FIX] is supported. | |
250363 | The profile level of video that you specified is not allowed. only [0] is supported | |
250364 | The reference frames of video that you specified is not allowed, only [1] is supported. | |
250365 | The video bitrate value that you specified is not allowed: video bitrate value is an integer greater than 0 | |
250366 | The width of video that you specified is not allowed: only width [integer between 128 and 1920] are supported. | |
250367 | The height of video that you specified is not allowed: only height [integer between 96 and 1920] are supported. | |
250368 | The frame rate of video that you specified is not allowed : only frame rate value [10, 15, 23.97, 24, 29.97, 30, 50, 60] are supported. | |
250370 | The rate control of video that you specified is not allowed : only width [VBR, CBR] are supported. | |
250372 | The request did not include the required "video" object | |
250373 | The request did not include the required "audio " object | |
250374 | Delete system quality profile is not allowed. | System quality profile は削除できません。 |
250375 | The request did not include the required "timedMetadata" object.(if "enableHlsTimedMetadata": true, timedMetadata object should be included.) | |
250376 | The timedmeta that you specified of key is not allowed: only "utc" is supported. | |
250377 | The request did not include the required "enableHlsTimedMeta" | |
250378 | The request do not include the required "audio bitrate" | |
250500 | Record filename is not valid : {0} | レコーディング·ファイル名が有効ではありません。 |
250501 | Record filename is not found : {0} | レコーディングファイルが見つかりません。 |
250502 | Record file upload error | レコーディングファイルをアップロード中にエラーが発生しました。 |
250504 | Can not delete Record file: {0} | レコーディングファイルは削除できません。 |
250505 | Can't get objectStorage's access oAuth | Object Storageにアクセスできる権限獲得に失敗しました。 |
250506 | ChannelId param should not be null when get record list. | レコーディングリストを照会するとき、CHANNEL IDパラメータが必要です。 |
250507 | Record status should be TRANSFER_READY or TRANSFER_FAIL when upload. | レコーディング·ファイルがアップロードできる状態ではありません。 TRANSFER_READY, TRANSFER_FAIL 状態の時のみ可能 |
250600 | Number must bigger than or equal to 1 | |
250700 | The record id has been requested already. | |
250701 | The record id that you request upload does not exist. | |
250702 | The record id does not exist. | |
250703 | The input bucket name that you specified is not allowed. | |
250704 | The output bucket name that you specified is not allowed. | |
250705 | The input bucket name doesn't exist. |
この記事は役に立ちましたか?