Has anyone successfully used this template with Python? I have looked up 
the media id with mediaService, but am still getting the INVALID_MEDIA_TYPE 
error. If anyone could post the code you are using to create template 433 
in Python it would be super helpful. 

This is the syntax I am trying to use:

ad_data = {
      'uniqueName': 'adData',
      'fields': [
          {
            'name': 'appStore',
            'fieldText': '1',
            'type': 'ENUM'
          },
          {
            'name': 'appId',
            'fieldText': '578830929',
            'type': 'TEXT'
          },
          {
            'name': 'headline',
            'fieldText': 'This is Headline',
            'type': 'TEXT'
          },
          {
            'name': 'description',
            'fieldText': 'This is Description',
            'type': 'TEXT'
          },
          {
            'name': 'skippableSeconds',
            'fieldText': '5',
            'type': 'NUMBER'
          },
          {
            'name': 'video',
            'fieldMedia': {
                'mediaId': video_media_id
            }
            'type': 'VIDEO'
          }
      ]
  }

This is the error I am getting: 

suds.WebFault: Server raised fault: '[MediaError.INVALID_MEDIA_TYPE @ 
operations[0].operand.ad.templateElements[0].fields[5].fieldMedia; 
trigger:'<null>']'

On Monday, September 21, 2015 at 5:09:56 AM UTC-7, Josh Radcliff (AdWords 
API Team) wrote:
>
> Hi Ankit,
>
> The template ads team has informed me that uploading YouTube videos 
> through *MediaService *is not supported at this time. Therefore, the only 
> option for the foreseeable future is to use the workaround I mentioned 
> earlier 
> <https://groups.google.com/d/msg/adwords-api/n4rKQcZaYTw/G3WpiJFD_RAJ>.
>
> Thanks,
> Josh, AdWords API Team
>
> On Thursday, September 3, 2015 at 2:58:58 PM UTC-4, Josh Radcliff (AdWords 
> API Team) wrote:
>>
>> Hi,
>>
>> Sorry, but I don't have an update at this time. For now, I'd recommend 
>> using the workaround I mentioned in my previous post 
>> <https://groups.google.com/d/msg/adwords-api/n4rKQcZaYTw/G3WpiJFD_RAJ>.
>>
>> Thanks,
>> Josh, AdWords API Team
>>
>> On Thursday, September 3, 2015 at 12:32:02 PM UTC-4, Ankit Jain wrote:
>>>
>>> Any updates on creating "TrueView In stream youtube ad" through API? 
>>>
>>> On Wednesday, July 22, 2015 at 11:10:54 AM UTC-4, Josh Radcliff (AdWords 
>>> API Team) wrote:
>>>>
>>>> Hi Richard,
>>>>
>>>> Unfortunately, I don't have an ETA for when or if this will be 
>>>> available, but I've passed your feedback along.
>>>>
>>>> Thanks,
>>>> Josh, AdWords API Team
>>>>
>>>> On Tuesday, July 21, 2015 at 5:03:54 PM UTC-4, Richard Biffin wrote:
>>>>>
>>>>> Hi Josh
>>>>>
>>>>> Thanks for this. Are you able to tell me if this will become available 
>>>>> in the future? Would be really handy to be able to do this without having 
>>>>> to do one first via the web interface.
>>>>>
>>>>> Richard
>>>>>
>>>>> On Wednesday, 22 July 2015 05:46:07 UTC+12, Josh Radcliff (AdWords API 
>>>>> Team) wrote:
>>>>>>
>>>>>> Hi Richard,
>>>>>>
>>>>>> I was able to create one of these ads through the user interface on a 
>>>>>> *Search 
>>>>>> Network with Display Select* campaign, but not on a *Display Network 
>>>>>> only* campaign. Were you trying to do this on a *Display Network 
>>>>>> only* campaign, perhaps?
>>>>>>
>>>>>> Regarding creating template ad ID 231 through the API, I've got good 
>>>>>> news and bad news. The bad news is that, as you suggested, you need a 
>>>>>> *mediaId* in order to create the ad, and the only way to do that 
>>>>>> (even for a YouTube video) is to create a template ad through the user 
>>>>>> interface that points to your YouTube video. After that, you can fetch 
>>>>>> the 
>>>>>> *mediaId* via MediaService 
>>>>>> <https://developers.google.com/adwords/api/docs/reference/v201506/MediaService>
>>>>>> .
>>>>>>
>>>>>> The good news is that once you've created at least one template ad 
>>>>>> that uses your YouTube video, you can use the generated *mediaId* to 
>>>>>> create additional template ads through the API that use that video. 
>>>>>> You'll 
>>>>>> need to include the following fields:
>>>>>>
>>>>>>    - displayUrl
>>>>>>    - finalUrls
>>>>>>    - templateId
>>>>>>    - templateElements
>>>>>>       - headline
>>>>>>       - description1
>>>>>>       - description2
>>>>>>       - videoId
>>>>>>          - type = VIDEO
>>>>>>          - fieldMedia
>>>>>>             - mediaId = the *mediaId* you retrieved via 
>>>>>>             *MediaService*
>>>>>>          - imageUrl
>>>>>>       - channelName
>>>>>>    - name
>>>>>>
>>>>>> Hope that helps!
>>>>>>
>>>>>> Cheers,
>>>>>> Josh, AdWords API Team
>>>>>>
>>>>>> On Monday, July 20, 2015 at 6:05:58 PM UTC-4, Richard Biffin wrote:
>>>>>>>
>>>>>>> Hi Josh
>>>>>>>
>>>>>>> I tried creating an ad based on the TrueView template within the 
>>>>>>> Adwords web interface. I can select the YouTube video fill out the form 
>>>>>>> but 
>>>>>>> every time I try and save the ad the error pops up saying  "Please 
>>>>>>> correct errors above"
>>>>>>>
>>>>>>> These are the steps I use to produce this problem.
>>>>>>>
>>>>>>> Login to Adwords using my test MCC account
>>>>>>> Select one of my client account which I created
>>>>>>> Create a Campaign of type "Search Network with Display Select" with 
>>>>>>> "All Features" checked
>>>>>>> Enter a daily budget (all other settings are default)
>>>>>>> Create Campaign
>>>>>>> Create an Ad Group with a default bid (all other settings are 
>>>>>>> default)
>>>>>>> On the Ad tab, click the  + Ad dropdown, select Ad Gallery
>>>>>>> Select Video Ads
>>>>>>> Select TrueView in-display video ad
>>>>>>> Fill out the Ad form
>>>>>>> Add Headline, Description
>>>>>>> Select a YouTube video (Looks like you can select any YouTube video) 
>>>>>>> At no point has it asked me to link my YouTube account.
>>>>>>> I select a YouTube video that I know about
>>>>>>> Select a thumbnail (it selects the first by default)
>>>>>>> Give it a name
>>>>>>> Hit Save
>>>>>>> Get error message "Please fix above errors"
>>>>>>>
>>>>>>> There are no errors to fix
>>>>>>>
>>>>>>> Screens
>>>>>>>
>>>>>>>
>>>>>>> <https://lh3.googleusercontent.com/-pSxI3YvXdp4/Va1rK70cEBI/AAAAAAAAFIs/JA51vn0QfuE/s1600/Screen%2BShot%2B2015-07-21%2Bat%2B9.35.28%2Bam.png>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> <https://lh3.googleusercontent.com/-c7orR3O8ADs/Va1rRpuM2BI/AAAAAAAAFI0/zTzyxxuBhrk/s1600/Screen%2BShot%2B2015-07-21%2Bat%2B9.35.41%2Bam.png>
>>>>>>>
>>>>>>>
>>>>>>> I have tried this with a proper Adwords account also, same issue. So 
>>>>>>> I can't query for a created ad via the API because it seems I can't 
>>>>>>> even 
>>>>>>> create one. This is all done via the standard Adwords interface (Online 
>>>>>>> Campaigns not Video Campaigns)
>>>>>>>
>>>>>>> Please advise, thanks
>>>>>>> Richard
>>>>>>>
>>>>>>>
>>>>>>> On Tuesday, 21 July 2015 04:57:01 UTC+12, Josh Radcliff (AdWords API 
>>>>>>> Team) wrote:
>>>>>>>>
>>>>>>>> Hi Richard,
>>>>>>>>
>>>>>>>> Might I suggest creating the ad through the AdWords user interface, 
>>>>>>>> then retrieving it via the API? The advantage to this approach is that 
>>>>>>>> we'll see precisely which fields of the template need to be populated, 
>>>>>>>> as 
>>>>>>>> well as how they are populated.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Josh, AdWords API Team
>>>>>>>>
>>>>>>>> On Sunday, July 19, 2015 at 4:59:15 PM UTC-4, Richard Biffin wrote:
>>>>>>>>>
>>>>>>>>> Hi Josh
>>>>>>>>>
>>>>>>>>> Thanks for the update. I have tried creating an ad based on the 
>>>>>>>>> TrueView template using this code, so only using the video_id
>>>>>>>>>
>>>>>>>>> template_ad = {
>>>>>>>>>   name: 'Ad Name',
>>>>>>>>>   display_url: 'youtube.com/channelname',
>>>>>>>>>   final_urls: [
>>>>>>>>>     'https://www.youtube.com/watch?v=videoid'
>>>>>>>>>   ],
>>>>>>>>>   xsi_type: 'TemplateAd',
>>>>>>>>>   template_id: "231",
>>>>>>>>>   template_elements: [
>>>>>>>>>     {
>>>>>>>>>       unique_name: "adData",
>>>>>>>>>       fields: [
>>>>>>>>>         {
>>>>>>>>>           name: 'videoId',
>>>>>>>>>           type: 'VIDEO',
>>>>>>>>>           field_text: params[:video_id]
>>>>>>>>>         },
>>>>>>>>>         {
>>>>>>>>>           name: 'imageUrl',
>>>>>>>>>           type: 'URL',
>>>>>>>>>           field_text: 'http://i.ytimg.com/vi/videoid/default.jpg'
>>>>>>>>>         },
>>>>>>>>>         {
>>>>>>>>>           name: 'channelName',
>>>>>>>>>           type: 'TEXT',
>>>>>>>>>           field_text: 'channelName'
>>>>>>>>>         },
>>>>>>>>>         {
>>>>>>>>>           name: 'headline',
>>>>>>>>>           type: 'TEXT',
>>>>>>>>>           field_text: 'Some Headline Text'
>>>>>>>>>         }
>>>>>>>>>       ]
>>>>>>>>>     }
>>>>>>>>>   ]
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> operation = {
>>>>>>>>>   operator: 'ADD',
>>>>>>>>>   operand: {
>>>>>>>>>     ad_group_id: ad_group_id,
>>>>>>>>>     ad: template_ad
>>>>>>>>>   }
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> service = $api.service(:AdGroupAdService, $version)
>>>>>>>>>
>>>>>>>>> ad = service.mutate([operation])
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I get back the error
>>>>>>>>>
>>>>>>>>> [AdError.EMPTY_FIELD @ 
>>>>>>>>> operations[0].operand.ad.templateElements[0].fields[0].fieldMedia; 
>>>>>>>>> trigger:'<null>'] 
>>>>>>>>>
>>>>>>>>> So I guess the field_media is required, but obviously using the 
>>>>>>>>> field media means I need to use the MediaService to query for the 
>>>>>>>>> mediaId 
>>>>>>>>> to include in the field_media. If I leave off the displayUrl, 
>>>>>>>>> finalUrls I 
>>>>>>>>> also get required field errors, the same if I leave off the imageUrl, 
>>>>>>>>> headline and channelName, these are all required.
>>>>>>>>>
>>>>>>>>> It seems to me to do with this
>>>>>>>>>
>>>>>>>>>         {
>>>>>>>>>           name: 'videoId',
>>>>>>>>>           type: 'VIDEO',
>>>>>>>>>           field_text: params[:video_id]
>>>>>>>>>         },
>>>>>>>>>
>>>>>>>>> The 'type' VIDEO requires the media_field to be included but this 
>>>>>>>>> seems to treat it as an in-stream video ad, which requires a 'video' 
>>>>>>>>> object 
>>>>>>>>> parameter instead of the TrueView template ad which requires only the 
>>>>>>>>> YouTube videoId. I am setting the template id to 231 which is the ID 
>>>>>>>>> for 
>>>>>>>>> the TrueView template.
>>>>>>>>>
>>>>>>>>> I don't understand why this requires a MediaService object if we 
>>>>>>>>> are already giving it the YouTube videoId.
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> Richard
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Saturday, 18 July 2015 03:26:19 UTC+12, Josh Radcliff (AdWords 
>>>>>>>>> API Team) wrote:
>>>>>>>>>>
>>>>>>>>>> Hi Richard,
>>>>>>>>>>
>>>>>>>>>> I spoke with our resident *MediaService* expert, and here are 
>>>>>>>>>> the key points:
>>>>>>>>>>
>>>>>>>>>>    1. The comment on MediaService.upload 
>>>>>>>>>>    
>>>>>>>>>> <https://developers.google.com/adwords/api/docs/reference/v201506/MediaService#upload>
>>>>>>>>>>  regarding 
>>>>>>>>>>    images is correct. You can only *upload* images through the 
>>>>>>>>>>    API. However, if you uploaded Audio or Video media objects 
>>>>>>>>>> *through 
>>>>>>>>>>    the user interface*, you'll be able to retrieve them via 
>>>>>>>>>>    MediaService.get 
>>>>>>>>>>    
>>>>>>>>>> <https://developers.google.com/adwords/api/docs/reference/v201506/MediaService#get>
>>>>>>>>>>     and MediaService.query 
>>>>>>>>>>    
>>>>>>>>>> <https://developers.google.com/adwords/api/docs/reference/v201506/MediaService#query>
>>>>>>>>>>    .
>>>>>>>>>>    2. When creating a TrueView template ad 
>>>>>>>>>>    
>>>>>>>>>> <https://developers.google.com/adwords/api/docs/appendix/templateads#pyv_ad_on_search>,
>>>>>>>>>>  
>>>>>>>>>>    you should specify the YouTube video ID for the *videoId* field 
>>>>>>>>>>    (without the URL -- just the ID).
>>>>>>>>>>    3. We're not sure if linking your YouTube and AdWords 
>>>>>>>>>>    accounts is required for the TrueView template. I'd recommend 
>>>>>>>>>> just giving 
>>>>>>>>>>    it a try without linking to see if you encounter any issues.
>>>>>>>>>>
>>>>>>>>>> Hope that helps!
>>>>>>>>>>
>>>>>>>>>> Cheers,
>>>>>>>>>> Josh, AdWords API Team
>>>>>>>>>>
>>>>>>>>>> On Thursday, July 16, 2015 at 7:13:36 PM UTC-4, Richard Biffin 
>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>> Hi Josh, are you saying that video uploading is supported? I 
>>>>>>>>>>> don't really want to upload I just want to link a YouTube video.
>>>>>>>>>>>
>>>>>>>>>>> I haven't tried yet because not sure how to do it, with an image 
>>>>>>>>>>> you can base64 encode and use the data property of the media object 
>>>>>>>>>>> but 
>>>>>>>>>>> according to the videos docs there is no data property. How do I 
>>>>>>>>>>> tell the 
>>>>>>>>>>> MediaService which video to upload or which YouTube video to use.
>>>>>>>>>>>
>>>>>>>>>>> This is what I currently have but doesn't work and wouldn't 
>>>>>>>>>>> really expect it to but not sure what else to try.
>>>>>>>>>>>
>>>>>>>>>>> service = $api.service(:MediaService, $version)
>>>>>>>>>>>     
>>>>>>>>>>> video = {
>>>>>>>>>>>     type: 'VIDEO',
>>>>>>>>>>>     you_tube_video_id_string: params[:video_id],
>>>>>>>>>>>     streaming_url: "
>>>>>>>>>>> http://youtube.com/get_video?video_id=#{params[:video_id]}";
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> service.upload([video])
>>>>>>>>>>>
>>>>>>>>>>> This creates an UnexpectedParametersError: 
>>>>>>>>>>> [:you_tube_video_id_string, :streaming_url])
>>>>>>>>>>>
>>>>>>>>>>> I am looking to create just a regular Adwords campaign with the 
>>>>>>>>>>> ad based on the TrueView template (template id 231). Based on the 
>>>>>>>>>>> template 
>>>>>>>>>>> docs all I need to do is give it a YouTube videoId and an optional 
>>>>>>>>>>> videoThumbnail and destinationPage
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> https://developers.google.com/adwords/api/docs/appendix/templateads#pyv_ad_on_search
>>>>>>>>>>>
>>>>>>>>>>> but this doesn't work, if I leave out the field_media, it starts 
>>>>>>>>>>> complaining about required field. So I add in field_media with 
>>>>>>>>>>> appropriate 
>>>>>>>>>>> properties but it requires a media_id which I can only get from the 
>>>>>>>>>>> MediaService, either by uploading (which doesn't work for videos) 
>>>>>>>>>>> or 
>>>>>>>>>>> creating an ad through the web interface, selecting a YouTube video 
>>>>>>>>>>> from 
>>>>>>>>>>> the ad gallery TrueView template, in fact you don't have to create 
>>>>>>>>>>> the ad, 
>>>>>>>>>>> all you have to do is select the YouTube video when starting to 
>>>>>>>>>>> create your 
>>>>>>>>>>> ad, which looks like it essentially associates the YouTube video to 
>>>>>>>>>>> the 
>>>>>>>>>>> Adwords account, this video is then part of the MediaService .get 
>>>>>>>>>>> collection via the API.
>>>>>>>>>>>
>>>>>>>>>>> Thanks
>>>>>>>>>>> Richard
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Friday, 17 July 2015 08:36:45 UTC+12, Josh Radcliff (AdWords 
>>>>>>>>>>> API Team) wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi Richard,
>>>>>>>>>>>>
>>>>>>>>>>>> It may be that the documentation on *MediaService* is 
>>>>>>>>>>>> outdated. Have you tried uploading your video via that service and 
>>>>>>>>>>>> it 
>>>>>>>>>>>> failed?
>>>>>>>>>>>>
>>>>>>>>>>>> Also, are you looking to set up these ads for an AdWords for 
>>>>>>>>>>>> Video campaign or a regular AdWords campaign? I ask because the 
>>>>>>>>>>>> AdWords API 
>>>>>>>>>>>> does not currently support managing AdWords for Video campaigns.
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>> Josh, AdWords API Team
>>>>>>>>>>>>
>>>>>>>>>>>> On Wednesday, July 15, 2015 at 6:25:51 PM UTC-4, Richard Biffin 
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Ok thanks for this. I was hoping to just link a YouTube video 
>>>>>>>>>>>>> as the media, not have to upload the video again. I see that the 
>>>>>>>>>>>>> MediaService has an upload function which currently only supports 
>>>>>>>>>>>>> images, 
>>>>>>>>>>>>> is there any plan to allow uploading of videos in the near future?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks
>>>>>>>>>>>>> Richard
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Thursday, 16 July 2015 04:38:28 UTC+12, Anthony Madrigal 
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi Richard,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> When creating video template ads 
>>>>>>>>>>>>>> <https://developers.google.com/adwords/api/docs/guides/template-ads#video_ads>,
>>>>>>>>>>>>>>  
>>>>>>>>>>>>>> you will need to use a video that is uploaded through the 
>>>>>>>>>>>>>> AdWords UI (since 
>>>>>>>>>>>>>> it is not supported through API). You are required to do so 
>>>>>>>>>>>>>> since the media 
>>>>>>>>>>>>>> ID is used to create the video ad and is used to retrieve video 
>>>>>>>>>>>>>> ads through 
>>>>>>>>>>>>>> the *MediaService.*
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Regards,
>>>>>>>>>>>>>> Anthony
>>>>>>>>>>>>>> AdWords API Team
>>>>>>>>>>>>>>
>>>>>>>>>>>>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/17fdd064-4aeb-4466-acd3-4b739cf1c617%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to