2.0 Media object

A media object represents an image, sound clip of video clip. Media objects are used as part of questions or answers, but also as drill icons, avatar, etc.

Typically, a media object will either contain the object itself in Base64-encoded binary format, or contain a URL as a reference to the object.

Example

{
  "type": "image/png",
  "url": "https://www.drillster.com/bin/attachment/d216edc7ff69e958e9622943d272d9cd27864a2b"
}

Fields

Field Type Description
type
optional
String The content type of the file or object.

Example values: image/png, audio/mp3, video/mpeg, application/pdf.
data
required if no url present
Base64-encoded binary The actual binary content of the object, represented as a Base64-encoded string.

Example value: iVBORw0KGgoAAAANSUhEUgAAAEAAAABAC…Tz+ubMQAAAABJRU5ErkJggg==
url
required if no data present
String A URL reference to an external media object.

Example value: https://www.drillster.com/bin/attachment/d216edc7ff69e958e9622943d272d9cd27864a2b
caption
optional
2.0 MarkupText object An optional (formatted) caption to accompany the media object.
width
optional
Integer The native width of the object, measured in pixels.

Example value: 400
height
optional
Integer The native height of the object, measured in pixels.

Example value: 400
thumbnail
optional
String A URL reference to an optional thumbnail. A thumbnail is always an image, and has a fixed size of 64 × 64 pixels.
thumbnails
optional
List of 2.0 Thumbnail objects An optional list of thumbnail variants. These are all equivalent thumbnail images in various sizes.