Media Data Object - Campaign Management

Defines the base object of media.

Do not try to instantiate a Media. You can create the following object that derives from it.

Syntax

<xs:complexType name="Media" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:sequence>
    <xs:element minOccurs="0" name="Id" nillable="true" type="xs:long" />
    <xs:element minOccurs="0" name="MediaType" nillable="true" type="xs:string" />
    <xs:element minOccurs="0" name="Text" nillable="true" type="xs:string">
      <xs:annotation>
        <xs:appinfo>
          <DefaultValue EmitDefaultValue="false" xmlns="http://schemas.microsoft.com/2003/10/Serialization/" />
        </xs:appinfo>
      </xs:annotation>
    </xs:element>
    <xs:element minOccurs="0" name="Type" nillable="true" type="xs:string" />
  </xs:sequence>
</xs:complexType>

Elements

The Media object has the following elements: Id, MediaType, Text, Type.

Element Description Data Type
Id The unique Microsoft Advertising identifier of the media.

Add: Read-only
long
MediaType The type of media to add to the media library.

The recommended sub type is "GenericImage".

For media that will be used with an ImageAdExtension, the supported values are GenericImage, Image16x9, Image15x10, Image4x3, and Image12x10.

For media that will be used with a ResponsiveAd, the supported values are GenericImage, Image1x1, Image191x100, and Image4x1.

For more information about supported aspect ratios, see the Image Data Object Remarks.

Add: Required
string
Text The media text. string
Type The media type. For more information about media types, see Remarks below.

Add: Read-only
string

Remarks

For Java and the .NET languages, do not set the Type element because the value is determined when you instantiate an image.

If you generate the SOAP manually, use the type attribute of the <Media> node as shown in the following example, to specify that the media is an image.

<Media xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <Media i:type="Image">
    <Id i:nil="true" />
    <MediaType>Image15x10</MediaType>
    <Type>Image</Type>
    <Data>DataForImageAdExtensionGoesHere</Data>
  </Media>
  <Media i:type="Image">
    <Id i:nil="true" />
    <MediaType>Image191x100</MediaType>
    <Type>Image</Type>
    <Data>DataForResponsiveAdGoesHere</Data>
  </Media>
</Media>

Requirements

Service: CampaignManagementService.svc v13
Namespace: https://bingads.microsoft.com/CampaignManagement/v13

Used By

AddMedia