API Documentation: Media Responses

  1. Notes
  2. Media Object
  3. Location Object
  4. Image Object
  5. Video Object
  6. Example Response


All requests will respond with, at the least, an Integer value for success. This value is either 1 or 0 to represent if the request was processed correctly or not. All requests will also return a String value for error and warnings. This will most likely be blank if you have a success value of 1. However, it is possible to have warnings if your uploaded data, for example, had to be truncated to the appropriate length.

Many responses will be within an array titled medias. In those cases, if you are expecting only one result, you can simply read the first object from that array. However, you should always check to make sure there is only one result when performing a query that could have multiple results rather than simply assume a single result. Exceptions to this are update, deactivate and activate, which return a single Media Object called media.

All functions of the API work exclusively with the Media Object. The purpose of the Media Object is to be a placeholder for an original piece of media uploaded to WellcomeMat, and to link to the appropriately encoded images and videos for that file. The encoded images/videos are linked through an attached Image Object and Video Object. When querying for media, you will always be returned a full description of the Media Object, meaning that it will also include all of the details for the Image Object and Video Object that are attached to that Media Object. If they do not exist, you will simply be returned null values for the Image Object and/or Video Object.

Please note that all return objects are, at their root, a success value, error string, warnings string, and an array of medias.

Media Object

Proper name JSON variable name Notes
ID hash The unique identifier for this media
WM1 ID wm1_id The unique identifier for this media in the old WellcomeMat, if it originated there.
Upload Source source How the video was uploaded into the site. You will only need this if you know what it is.
Traffic Generation Override traffic_url Traffic override to point all viewers to a webpage where you have embedded your video.
Created created The timestamp that this video was created
Updated updated The timestamp that this video was last replaced
Data Updated data_updated The timestamp at which any associated data was updated
Status Code status_code Media Status details
Status Message status_message Media Status details
Title title
Description description
Keywords keywords
Custom ID customid This field is often used as a listing id
Original Filesize original_size_bytes The size of the original in bytes
Original Filesize original_size_readable The size of the original in a human-readable form, e.g. 248mb
Slideshow slideshow Whether the video is marked as a slideshow or not (0 or 1)
Video Type video_type An id indicating video type
Location Object location
Image Object image
Video Object video
Playlists playlists The playlists that this video matches

Location Object

Proper name JSON variable name Notes
Address address
City city
State/Province state_province
Postal Code postal_code
Latitude latitude
Longitude longitude

Image Object

Proper name JSON variable name Notes Ratio
ID hash The unique identifier for this image
HTTP URL http_url The URL where you can retrieve this object's files
Icon Image Filename icon 50x50 1:1
Square Image Filename square 125x125 1:1
Thumbnail Image Filename thumbnail 213x120 16:9
Thumbnail Image Filename (larger) thumbnail_16x9 320x180 16:9
Small Image Filename small 640x360 16:9
Medium Image Filename medium 1280x720 (if available) 16:9
Large Image Filename large 1920x1080 (if available) 16:9
Play Image Filename play 640x360 with click-to-play overlay 16:9

Video Object

Proper name JSON variable name Notes
HTTP URL http_url URL to retrieve this object's files via HTTP GET
HTTPS URL https_url URL to retrieve this object's files via HTTPS GET
HTTP STREAMING URL http_streaming_url URL to retrieve this object's files via HTTP GET in streaming format
HLS URL hls_url URL to retrieve this object's files via HLS - this will return an *.m3u8 Playlist File pointing to the file version specified
270p Mobile Video Filename v270p
360p Low Quality Video Filename v360p
480p Normal Quality Video Filename v480p
720p HD Video Filename v720p
1080p HD Video Filename v1080p

Example Response

Endpoint: https://www.wellcomemat.com/api/media/query.php
Parameters Supplied: key, secret, hash

  "success": 1,
  "error": "",
  "warnings": "",
  "medias": [
      "hash": "sn5dd2704bd5vt5",
      "created": "2016-09-27 17:26:04 EST",
      "replaced": "2016-09-27 17:24:13 EST",
      "data_updated": "2017-05-01 12:10:07 EST",
      "status_code": "400",
      "status_message": "Active",
      "title": "The Whistles Go Woo Test",
      "description": "This is a test video uploaded by Logan using logan@wellcomemat.com",
      "keywords": "whistles,Oakland,California",
      "customid": "logan1337",
      "original_https_url": "https://e01191cf62cece119a40-7b33788af20eb16deff7769bccdf782b.ssl.cf1.rackcdn.com/",
      "original": "original_sn5dd2704bd5vt5_oe6m7g.mp4",
      "source": "site",
      "traffic_url": null,
      "slideshow": "0",
      "video_type": "9",
      "location": {
        "address": "997 Harlan St",
        "city": "San Leandro",
        "state_province": "California",
        "postal_code": "94577",
        "latitude": "37.714889200000",
        "longitude": "-122.161064100000"
      "image": {
        "hash": "5vt52cab3387sloe",
        "https_url": "https://0f09f3dc97720fdbfce6-edffc6cf84a1214568eae26dc2113f20.ssl.cf1.rackcdn.com/",
        "icon": null,
        "square": null,
        "thumbnail": "sn5dd2704bd5vt5_5vt55d55e48fsloe_thumbnail.jpg",
        "thumbnail_16x9": "sn5dd2704bd5vt5_5vt55d55e48fsloe_thumbnail16x9.jpg",
        "small": "sn5dd2704bd5vt5_5vt55d55e48fsloe_small.jpg",
        "medium": "sn5dd2704bd5vt5_5vt55d55e48fsloe_medium.jpg",
        "large": "sn5dd2704bd5vt5_5vt598b475a0sloe_large.jpg",
        "play": "sn5dd2704bd5vt5_5vt5b698aff3sloe_play.jpg"
      "video": {
        "https_url": "http://0f837d73c52260b6ff9d-eaef829eae7c04fd12005cc3ad780db0.r48.cf1.rackcdn.com/",
        "v270p": "sn5dd2704bd5vt5_fdc09332_270p.mp4",
        "v360p": "sn5dd2704bd5vt5_fdc09332_360p.mp4",
        "v480p": null,
        "v720p": null,
        "v1080p": null