料金プランブログエンタープライズAPI
ログイン無料で始める
ログイン無料で始める

02 / エンドポイント

Captions

字幕の保存 (commit)

API キーが必要
PUT/api/enterprise/v1/generated-videos/{videoId}/captions

確認・編集を終えた字幕を動画に保存します。

  • Body の各 clips[].index は、動画の VideoClip.index と 1 対 1 で一致する必要があります。
  • 一致しない場合や形式が誤っている場合は INVALID_CAPTION_PAYLOAD(400)。
  • 1 つのトランザクション内で、各 clip の captionWords / captionWordGroups を更新します。

パスパラメータ

フィールド型必須説明
videoIdstring必須生成ショート動画 ID例: gsv_001

リクエストボディCaptionsSaveRequest

フィールド型必須説明
clips[]CaptionClipPreview[]必須保存する clip 配列。各 index は動画の VideoClip.index と 1 対 1 で一致する必要があり、index の重複は許可されません。
indexnumber必須VideoClip.index と一致
segmentIdstring必須
captionWords[]CaptionWord[]必須
indexinteger必須そのタイムライン内の単語 index例: 0
textstring必須字幕の単語例: hello
startnumber必須タイムライン基準の開始時刻 (ms)。source では元の Longform 基準、generatedVideos では生成ショート基準です。例: 1200
endnumber必須タイムライン基準の終了時刻 (ms)。source では元の Longform 基準、generatedVideos では生成ショート基準です。例: 1450
metadataobject任意内部の字幕メタデータ
captionWordGroups[]CaptionWordGroup[]必須
indexinteger必須word group index例: 0
indexes[]integer[]必須グループに含まれる単語の indexes例: [0,1,2]
リクエスト例
{
  "clips": [
    {
      "index": 0,
      "segmentId": "string",
      "captionWords": [
        {
          "index": 0,
          "text": "hello",
          "start": 1200,
          "end": 1450
        }
      ],
      "captionWordGroups": [
        {
          "index": 0,
          "indexes": [
            0,
            1,
            2
          ]
        }
      ]
    }
  ]
}

レスポンス

ステータス意味
200字幕の保存に成功CaptionsSaveResponse
400本文が不正 / clip index の不一致ErrorResponse
401認証に失敗ErrorResponse
404動画が見つかりませんErrorResponse

レスポンス 200CaptionsSaveResponse

フィールド型必須説明
requestIdstring必須
videoobject必須
idstring必須
updatedClipCountnumber必須保存された clip 数
updatedAtstring必須保存日時 (ISO 8601)
レスポンス例
{
  "requestId": "string",
  "video": {
    "id": "string"
  },
  "updatedClipCount": 0,
  "updatedAt": "string"
}