Caution: You are viewing documentation for the API's REST interface. Most of our official client libraries use gRPC. See the REST Introduction for details.

REST Resource: customers.mediaFiles

Resource: MediaFile

A media file.

JSON representation
{
  "resourceName": string,
  "type": enum (MediaType),
  "mimeType": enum (MimeType),
  "id": string,
  "sourceUrl": string,
  "name": string,
  "fileSize": string,

  // Union field mediatype can be only one of the following:
  "image": {
    object (MediaImage)
  },
  "mediaBundle": {
    object (MediaBundle)
  },
  "audio": {
    object (MediaAudio)
  },
  "video": {
    object (MediaVideo)
  }
  // End of list of possible types for union field mediatype.
}
Fields
resourceName

string

Immutable. The resource name of the media file. Media file resource names have the form:

customers/{customerId}/mediaFiles/{media_file_id}

type

enum (MediaType)

Immutable. Type of the media file.

mimeType

enum (MimeType)

Output only. The mime type of the media file.

id

string (int64 format)

Output only. The ID of the media file.

sourceUrl

string

Immutable. The URL of where the original media file was downloaded from (or a file name). Only used for media of type AUDIO and IMAGE.

name

string

Immutable. The name of the media file. The name can be used by clients to help identify previously uploaded media.

fileSize

string (int64 format)

Output only. The size of the media file in bytes.

Union field mediatype. The specific type of the media file. mediatype can be only one of the following:
image

object (MediaImage)

Immutable. Encapsulates an Image.

mediaBundle

object (MediaBundle)

Immutable. A ZIP archive media the content of which contains HTML5 assets.

audio

object (MediaAudio)

Output only. Encapsulates an Audio.

video

object (MediaVideo)

Immutable. Encapsulates a Video.

MediaType

The type of media.

Enums
UNSPECIFIED The media type has not been specified.
UNKNOWN

The received value is not known in this version.

This is a response-only value.

IMAGE Static image, used for image ad.
ICON Small image, used for map ad.
MEDIA_BUNDLE ZIP file, used in fields of template ads.
AUDIO Audio file.
VIDEO Video file.
DYNAMIC_IMAGE Animated image, such as animated GIF.

MediaImage

Encapsulates an Image.

JSON representation
{
  "data": string,
  "fullSizeImageUrl": string,
  "previewSizeImageUrl": string
}
Fields
data

string (bytes format)

Immutable. Raw image data.

A base64-encoded string.

fullSizeImageUrl

string

Output only. The url to the full size version of the image.

previewSizeImageUrl

string

Output only. The url to the preview size version of the image.

MediaBundle

Represents a ZIP archive media the content of which contains HTML5 assets.

JSON representation
{
  "data": string,
  "url": string
}
Fields
data

string (bytes format)

Immutable. Raw zipped data.

A base64-encoded string.

url

string

Output only. The url to access the uploaded zipped data. E.g. https://tpc.googlesyndication.com/simgad/123 This field is read-only.

MediaAudio

Encapsulates an Audio.

JSON representation
{
  "adDurationMillis": string
}
Fields
adDurationMillis

string (int64 format)

Output only. The duration of the Audio in milliseconds.

MediaVideo

Encapsulates a Video.

JSON representation
{
  "adDurationMillis": string,
  "youtubeVideoId": string,
  "advertisingIdCode": string,
  "isciCode": string
}
Fields
adDurationMillis

string (int64 format)

Output only. The duration of the Video in milliseconds.

youtubeVideoId

string

Immutable. The YouTube video ID (as seen in YouTube URLs). Adding prefix "https://www.youtube.com/watch?v=" to this ID will get the YouTube streaming URL for this video.

advertisingIdCode

string

Output only. The Advertising Digital Identification code for this video, as defined by the American Association of Advertising Agencies, used mainly for television commercials.

isciCode

string

Output only. The Industry Standard Commercial Identifier code for this video, used mainly for television commercials.

Methods

get

Returns the requested media file in full detail.

mutate

Creates media files.