Skip to content

Why does our completed-job viewer try to play a JSON download as an MP4?

Use the job kind and response media type to choose the preview. AISwapLab's private content route can serve images, video or text-job JSON. The word completed identifies job state without specifying that the attached result is video.

SHIP A RELIABLE INTEGRATIONAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval

Validate before rendering

Check the documented kind, then verify transport response and media type. Treat an error body as a diagnostic and keep the current job record.

Use a suitable viewer

Route an authorized video response to playback and JSON to a text view. If the actual type disagrees with the expected attachment, report that fact rather than silently renaming it.

Example

A creative project carries a text generation for its brief and a separate video result. Both are completed, and only the second belongs in the video player.

Pass condition

The product renders each confirmed result using its actual documented kind and retains clear error states.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation