API Documentation: Media Responses

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

Notes

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
User_ID user_id The userID associated with this video
Title title
Description description
Keywords keywords Comma separated list of keywords("tags"). Returned media will have all of the keywords("tags")
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

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
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

Preview Object

Proper name JSON variable name Notes
Preview ID preview_id The unique identifier for the video preview.
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
270p Mobile Preview Filename v270p_preview
360p Low Quality Preview Filename v360p_preview
480p Normal Quality Preview Filename v480p_preview
720p HD Preview Filename v720p_preview
1080p HD Preview Filename v1080p_preview
GIF Preview GIF_preview A .gif file generated from the preview.

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
Thumbnail Image Filename thumbnail_16x9 320x180 (Taken at 75% of video length) 16:9
Large Image Filename large 1920x1080 (Taken at 75% of video length) 16:9
Play Image Filename play 640x360 (Taken at 75% of video length) 16:9
Play Image Filename - play svg click_to_play_SVG click-to-play-icon svg overlay SVG

Example Response

Endpoint: https://www.wellcomemat.com/api/media/query.php
Parameters Supplied: key, secret, (hash or customid)
  {
    "success": 1,
    "error": "",
    "warnings": "",
    "medias": [
    {
      "hash": "ekab417d115g63",
      "created": "2020-05-04 11:58:22 EST",
      "replaced": "2021-05-20 11:54:07 EST",
      "data_updated": "2021-08-31 15:58:09 EST",
      "status_code": "400",
      "status_message": "Active",
      "user_id": "4622",
      "title": "Really Awesome Title",
      "description": "Really awesome description",
      "keywords": "Chef Kitchen, Mountain Views",
      "customid": "753357111",
      "original_size_bytes": "284965881",
      "original_size_readable": "28.8mb",
      "source": "site",
      "traffic_url": null,
      "slideshow": "0",
      "video_type": "1",
      "price": "45,000",
      "location": {
          "address": "1611 Boulder Rd.",
          "city": "Boulder",
          "state_province": "CO",
          "postal_code": "80305",
          "latitude": "46.056411700000",
          "longitude": "-106.202066600000"
      },
      "video": {
          "http_url": "http://8b651a9a92e3e35ae33d-eaef829eae7c04fd12005cc3ad780db0.r48.cf1.rackcdn.com/",
          "https_url": "https://424ab3360cd45b4ab42b-eaef829eae7c04fd12005cc3ad780db0.ssl.cf1.rackcdn.com/",
          "v270p": "ekab417d11563_1eba4334_360p.mp4",
          "v360p": "ekab417d11563_1eba4334_360p.mp4",
          "v480p": "ekab417d11563_9fefaafb_480p.mp4",
          "v720p": "ekab417d11563_57607ba5_720p.mp4",
          "v1080p": null,
          "storage_size_bytes": "50923520",
          "storage_size_readable": "49.7mb"
      },
      "preview": {
          "preview_id": "1472",
          "http_url": "http://8b651a9a92e3e35ae33d-eaef829eae7c04fd12005cc3ad780db0.r48.cf1.rackcdn.com/",
          "https_url": "https://424ab3360cd45b4ab42b-eaef829eae7c04fd12005cc3ad780db0.ssl.cf1.rackcdn.com/",
          "v270p_preview": "ek3e4f8ca81bie7_267a2237_preview270p.mp4",
          "v360p_preview": "ek3e4f8ca81bie7_0d3f7d42_preview360p.mp4",
          "v480p_preview": "ek3e4f8ca81bie7_434e3263_preview480p.mp4",
          "v720p_preview": "ek3e4f8ca81bie7_6598eaf6_preview720p.mp4",
          "v1080p_preview": null,
          "GIF_preview": "ek3e4f8ca81bie7_33636d9c_preview.gif"
      },
      "image": {
        "id": "7463561",
        "hash": "1bie7360c123973ok9",
        "https_url": "https://0f09f3dc97720fdbfce6-edffc6cf84a1214568eae26dc2113f20.ssl.cf1.rackcdn.com/",
        "large": "ek3e4f8ca81bie7_1bie75bd56df473ok9_large.jpg",
        "thumbnail_16x9": "ek3e4f8ca81bie7_1bie7360c123973ok9_thumbnail16x9.jpg",
        "play_image": "1821058050_1dd630bd34_play.jpg",
        "click_to_play_SVG": 
 <svg width="75" height="75" class="play-pop" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
      viewBox="0 0 52.805 52.805" enable-background="new 0 0 52.805 52.805" xml:space="preserve">
 <g>
 <path fill="#ffffff" opacity=".9" d="M50.377,0H2.428C1.087,0,0,1.087,0,2.428v47.949c0,1.341,1.087,2.428,2.428,2.428h47.949
              c1.341,0,2.428-1.087,2.428-2.428V2.428C52.805,1.087,51.718,0,50.377,0z M26.403,44.16c-9.807,0-17.758-7.951-17.758-17.758
 s7.95-17.758,17.758-17.758s17.758,7.951,17.758,17.758S36.21,44.16,26.403,44.16z"/>
 <g opacity=".9">
 <path fill="#ffffff" d="M32.022,25.178l-7.477-5.432c-0.437-0.317-1.048-0.367-1.532-0.12c-0.496,0.253-0.803,0.755-0.803,1.31
 v10.862c0,0.555,0.308,1.058,0.803,1.31c0.205,0.105,0.436,0.16,0.667,0.16c0.313,0,0.613-0.097,0.865-0.28l7.476-5.43
 c0.38-0.275,0.607-0.72,0.607-1.19C32.628,25.898,32.401,25.453,32.022,25.178z"/>
 </g>
 </g>
 </svg>
      },
    }
  ]
}

Close