Hello,

The AdWords API currently does not support creating new YoutubeVideoMedia,
so you need to manually set the campaign's YouTube Video assets through the
AdWords UI. If you already have existing youtube media in your account, you
will be able to use CampaignService.mutate() to add new settings to the
campaign. You will need to do a MediaService.get()
<https://developers.google.com/adwords/api/docs/reference/v201806/MediaService#get> to
get the specific youtube media Id and then use the UniversalAppSetting
<https://developers.google.com/adwords/api/docs/reference/v201806/CampaignService.UniversalAppCampaignSetting> to
add the new media setting to the campaign. Please find the code snippet
below as a reference:

UniversalAppCampaignSetting universalAppSetting = new
UniversalAppCampaignSetting();
universalAppSetting.setYoutubeVideoMediaIds(new long[] {4390676349L});
campaign.setSettings(new Setting[] {universalAppSetting});

CampaignOperation operation = new CampaignOperation();
operation.setOperand(campaign);
operation.setOperator(Operator.SET);

If you're still having an issue, could you please share the API SOAP logs,
so I can take a closer look?

Thanks,
Bharani, AdWords API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 02/22/19 11:20:13 i.tir...@corp.mail.ru wrote:

Hello!

Why I can't change youtubeVideoMediaIds list in my UAC (but this UAC is
Video ads only), but for other campaigns in my account I can do this
operation

This is my code:

self.settings = {
    'xsi_type': 'UniversalAppCampaignSetting',
    'youtubeVideoMediaIdsOps': self.video_ids,
}

def _update_media_data(self):
    operations = [{
        'operator': 'SET',
        'operand': {
            'id': self.campaign.id,
            'settings': self.settings
        }
    }]
    print(operations)
    return
self.campaign_service.mutate(operations)['value'][0]['settings'][1]['youtubeVideoMediaIds']

this code works for other campaigns and I can change youtube media ids but
in this UAC can't

this is error:

*googleads.errors.GoogleAdsServerFault:
[SettingError.YOUTUBE_MEDIA_IDS_REQUIRED_IN_VIDEO_ONLY_UAC @
operations[0].operand.settings[0].youtubeVideoMediaIds; trigger:'[]']*

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 and Google Ads 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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/d69ba090-74d8-49bb-8daf-b523a19c789b%40googlegroups.com
<https://groups.google.com/d/msgid/adwords-api/d69ba090-74d8-49bb-8daf-b523a19c789b%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 and Google Ads 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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ijlio23g30000000g194q4000aa2pkw60mjed1k6oo30c1g68qj6e1j%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
  • Can't m... i.tirsky via AdWords API and Google Ads API Forum
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
      • ... i.tirsky via AdWords API and Google Ads API Forum
        • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
    • Re... i.tirsky via AdWords API and Google Ads API Forum
      • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum

Reply via email to