Thank you a lot for reponse and hello again!

According to your answer my first assumption was right - to manage this via 
CampaignService by mutating UniversalAppSetting. That works for text assets 
but does not for video medias:

srv = adwords.service(:CampaignService, :v201809)

srv.mutate([
  { 
    operator: 'SET',
    operand: {
      id: XXX,
      settings: [
        {
          xsi_type: 'UniversalAppCampaignSetting',

          # This works! :)
          description1: 'lalala',

          # Bit this doesn't :(
          # youtubeVideoMediaIds: [YYY],
          # youtubeVideoMediaIdsOps: ['REMOVE']
        }
      ]
    }
  }
])

I am using the latest version of ruby client for your 
API: google-adwords-api (1.5.0)
Is that issue related to my misunderstanding or to ruby liblary?
Hope we will fight this problem together!

On Thursday, June 27, 2019 at 6:42:45 PM UTC+3, adsapiforumadvisor wrote:
>
> Hello Sama, 
>
> Thank you for clarifying this. 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);
>
> Let me know if you have any other questions. 
>
> Thanks,
> Bharani, Google Ads API Team
>
> ref:_00D1U1174p._5001UCZBhj:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/e1551c40-763f-4b72-a65a-994c21e55748%40googlegroups.com.

Reply via email to