Media API
Media Details
Video Type Id
A media needs a video type before it can go live.
| Video Type Id | Title |
|---|---|
| 1 | Residential Real Estate |
| 2 | Business Profile |
| 3 | Neighborhood Tour |
| 4 | Market Reports / Updates |
| 5 | City Highlight / Community Tour |
| 6 | Miscellaneous |
| 7 | News |
| 8 | How-To Guide |
| 9 | Event |
| 11 | Profile Video |
| 15 | Commercial Real Estate |
| 16 | Hotel |
| 17 | School Tour |
| 18 | Things to Do |
| 19 | Inspection |
| 20 | Vacation Rental |
| 21 | Land |
| 22 | Video Clip |
| 99 | Private |
Media Status Code
When a video is first uploaded to WellcomeMat the returned status code should be 100 File Received. At that point, the encoding system will process the file accordingly, and you can track its encoding status by querying the media. As files become ready, they are immediately pushed into the cloud and out to the CDN delivery service.
| Media Status Code | Definition |
|---|---|
| 000 | File not received |
| 100 | File received |
| 200 | Queued for encoding |
| 310 | Generating images |
| 320 | Encoding 720p video |
| 330 | Encoding 360p video |
| 340 | Encoding 270p mobile video |
| 350 | Encoding 480p video |
| 360 | Encoding 1080p video |
| 400 | Active |
| 410 | Encoded, needs a video type to go active |
| 500 | Inactive |
| 600 | Encode Failed |
| 700 | Marked for deletion |
Response Types
The following response types are found in Media responses.
type Media = {
media_id: number;
hash: string; // The primary lookup key for the media, for example "5isp21d3cb831kank".
created: string; // Formatted as `YYYY-MM-DD hh:mm:ss {EDT|EST}`.
replaced: string; // Formatted as `YYYY-MM-DD hh:mm:ss {EDT|EST}`.
data_updated: string; // Formatted as `YYYY-MM-DD hh:mm:ss {EDT|EST}`.
status_code: "000"|"100"|"200"|"310"|"320"|"330"|"340"|"350"|"360"|"400"|"410"|"500"|"600"|"700";
status_message: string; // The message for the media's status code.
status_group: "File Not Received"|"File Received"|"Processing"|"Active"|"Pending"|"Inactive"|"Encode Failed"|"Deleted";
is_ready: boolean;
user_id: string; // An integer, written as a string.
title: string;
description: string;
keywords: string;
customid: string;
original_file: string;
original_size_bytes: string; // An integer, written as a string.
original_size_readable: string; // For example, "2.8mb".
source: string; // For example, "api", "ingest", "site", or "toolset".
traffic_url: string | null;
slideshow: "0" | "1";
video_type: string; // An integer, written as a string.
location: {
address: string | null;
city: string | null;
state_province: string | null;
postal_code: string | null;
latitude: string | null;
longitude: string | null;
};
video: {
https_url: string; // The base URL the files are served from, such as `https://{hostname}/`.
v270p: string | null;
v360p: string | null;
v480p: string | null;
v720p: string | null;
v1080p: string | null;
length: string; // An integer, written as a string.
storage_size_bytes: string; // An integer, written as a string.
storage_size_readable: string; // For example, "11.0mb".
};
preview: null | {
preview_id: string; // The unique identifier for the video preview, an integer written as a string.
https_url: string; // The base URL the files are served from, such as `https://{hostname}/`.
wellcomematBaseUrl?: string; // A second base URL, served by WellcomeMat rather than by the CDN. Join any preview
// filename below onto it exactly as you would onto `https_url`. Fetching through it
// records that the preview was displayed, then redirects to the identical file on the
// CDN, so what a visitor sees is unchanged. It counts displays of the video and
// identifies no visitor. It sets no cookie and records nothing about the viewer.
// It is absent only while the service that builds it is unreachable, so treat it as
// optional and fall back to `https_url`.
v270p_preview: string | null; // The filename of the 270p mobile preview.
v360p_preview: string | null; // The filename of the 360p low-quality preview.
v480p_preview: string | null; // The filename of the 480p normal-quality preview.
v720p_preview: string | null; // The filename of the 720p HD preview.
v1080p_preview: string | null; // The filename of the 1080p HD preview.
GIF_preview: string | null; // The filename of the GIF generated from the preview.
};
image: {
hash: string; // The image's own hash, which differs from the media hash.
https_url: string; // The base URL the files are served from, such as `https://{hostname}/`.
large: string; // At most 1920x1080.
thumbnail_16x9: string; // Scaled and cropped to 320x180.
play: string; // Scaled and cropped to 640x360.
};
photos: {
https_url: string; // The base URL the files are served from, with no trailing slash, such as `https://{hostname}`.
seconds: {
[second: string]: string; // The filename of the photo taken at that second.
};
};
links: {
base: string;
embed: string;
share: string;
unbranded_base: string;
unbranded_embed: string;
};
};