course_subtitles_apply
Adds an SRT/VTT subtitle (uploaded from this computer) or deletes one on a video lesson in the Course app (pApp C00007). Shows a preview first; the change runs only after confirmation. Called without confirmToken it previews and returns a confirmToken; repeating the same input with it executes once.
Inputs
| Field | Required here | Contract |
|---|---|---|
postId |
Yes | integer; greater than 0 |
action |
Yes | one of: create, delete (by kind) |
action.source |
Yes | When action.kind is create: object; Upload the SRT or VTT file from this computer: upload {kind:"local-file", filename, byteLength} returns presigned part URLs; PUT the parts, then call again with upload {kind:"complete", uploadId, parts}. |
action.source.kind |
Yes | When action.kind is create: upload |
action.source.upload |
Yes | When action.kind is create: one of: local-file, more-parts, complete, cancel (by kind) |
action.source.upload.filename |
Yes | When action.kind is create and action.source.upload.kind is local-file: string; min length 1; max length 240; pattern ^[^/\\:\x00-\x1f\x7f]+$; The name of the file on this computer, with its extension. |
action.source.upload.byteLength |
Yes | When action.kind is create and action.source.upload.kind is local-file: integer; greater than 0; The exact file size in bytes (for example from wc -c < FILE or stat). |
action.source.upload.sha256 |
No | When action.kind is create and action.source.upload.kind is local-file: string; pattern ^[0-9a-f]{64}$; The SHA-256 of the file in lowercase hex (shasum -a 256 FILE). Required when the upload answers UPLOAD_CHECKSUM_REQUIRED. |
action.source.upload.uploadId |
Yes | When action.kind is create and action.source.upload.kind is more-parts: string; pattern ^upl_[A-Za-z0-9_-]{22}$ |
action.source.upload.fromPart |
Yes | When action.kind is create and action.source.upload.kind is more-parts: integer; minimum 1; maximum 10000 |
action.source.upload.uploadId |
Yes | When action.kind is create and action.source.upload.kind is complete: string; pattern ^upl_[A-Za-z0-9_-]{22}$ |
action.source.upload.parts |
Yes | When action.kind is create and action.source.upload.kind is complete: array; min items 1; max items 10000 |
action.source.upload.parts[].partNumber |
Yes | When action.kind is create and action.source.upload.kind is complete: integer; minimum 1; maximum 10000 |
action.source.upload.parts[].etag |
Yes | When action.kind is create and action.source.upload.kind is complete: string; min length 1; max length 200 |
action.source.upload.measured |
No | When action.kind is create and action.source.upload.kind is complete: object; What the video measures on this computer, read with measureCommand. |
action.source.upload.measured.durationSeconds |
Yes | When action.kind is create and action.source.upload.kind is complete: number; maximum 1000000; greater than 0; Video duration in seconds (ffprobe format.duration). |
action.source.upload.measured.frameRate |
Yes | When action.kind is create and action.source.upload.kind is complete: number; maximum 1000; greater than 0; Frames per second (ffprobe avg_frame_rate, for example 30000/1001 = 29.97). |
action.source.upload.measured.width |
Yes | When action.kind is create and action.source.upload.kind is complete: integer; maximum 100000; greater than 0 |
action.source.upload.measured.height |
Yes | When action.kind is create and action.source.upload.kind is complete: integer; maximum 100000; greater than 0 |
action.source.upload.measured.frameRateMode |
No | When action.kind is create and action.source.upload.kind is complete: CFR, VFR; Constant or variable frame rate, when the tool reports it. |
action.source.upload.measured.minFrameRate |
No | When action.kind is create and action.source.upload.kind is complete: number; maximum 1000; greater than 0 |
action.source.upload.measured.maxFrameRate |
No | When action.kind is create and action.source.upload.kind is complete: number; maximum 1000; greater than 0 |
action.source.upload.uploadId |
Yes | When action.kind is create and action.source.upload.kind is cancel: string; pattern ^upl_[A-Za-z0-9_-]{22}$ |
action.language |
Yes | When action.kind is create: ko, ja, en, zh, es, fr, de, ar, be, bn, bg, ca, zh-CN, zh-HK, zh-TW, hr, cs, da, nl, en-AU, en-CA, en-GB, en-IE, en-IN, en-SG, en-ZA, et, fa, fil, fi, fr-CA, fr-CH, el, gu, he, hi, hu, is, id, it, lo, lv, lt, ms, no, pl, pt, pt-BR, ro, ru, sr, sk, sl, es-419, es-US, sw, sv, tl, th, tr, uk, ur, vi |
action.subtitleId |
Yes | When action.kind is delete: string; pattern ^[A-Za-z0-9][A-Za-z0-9_-]{0,255}$ |
action.confirmation |
Yes | When action.kind is delete: DELETE_MEDIA_SUBTITLE |
confirmToken |
No | string; pattern ^ct[a-f\d]{32}$; The confirmToken from this tool's preview result. Omit it to preview; repeat the same input with it to execute. |