Hi,
If you're going to mutate your youtubeVideoMediaIds
<https://developers.google.com/adwords/api/docs/reference/v201809/CampaignService.UniversalAppCampaignSetting#youtubevideomediaids>,
you should use the youtubeVideoMediaIdsOps
<https://developers.google.com/adwords/api/docs/reference/v201809/CampaignService.UniversalAppCampaignSetting#youtubevideomediaidsops>
instead
and use the ListOperations
<https://developers.google.com/adwords/api/docs/reference/v201809/CampaignService.ListOperations>
to
update the list of your youtubeVideoMediaIds. You may check this guide
<https://developers.google.com/adwords/api/docs/guides/mobile-app-campaigns#working_with_listoperations>
for
more details about the ListOperations in UAC.
Thanks and regards,
Luis
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/14/19 03:09:13 [email protected] wrote:
Hello! I'm using CampaignService for updating of youtubeVideoMediaIds in my
Campaign (UniversalAppCampaign)
https://developers.google.com/adwords/api/docs/reference/v201809/CampaignService.CampaignOperation
And trying to use this:
from googleads import adwords
client = adwords.AdWordsClient.LoadFromStorage("googleads.yaml") # path to
yaml file wherever it exists
campaign_service = client.GetService('CampaignService', version='v201809')
campaign_id = 000000
video_ids = [111111, 111112] # Input MediaId(s) here
def update_media_data(campaign_service, campaign_id, video_ids):
operations = [{
'operator': 'SET', #REMOVE using too, but this cause an error
'operand': {
'xsi_type': 'Campaign',
'id': campaign_id,
'settings': {
'xsi_type': 'UniversalAppCampaignSetting',
'youtubeVideoMediaIds': video_ids
}
}
}]
return campaign_service.mutate(operations)
What I'm doing wrong? If I try to update video list with new videos using
SET and
Why I can't use REMOVE to remove some video_ids from this list of
youtubeVideoMediaIds how to do it correct?
Thank you!
I have full list of youtube videos - 20 videos on Campaign. But I can't
remove any videos with this API call...
def update_media_data(campaign_service, campaign_id, video_ids):
operations = [{
'operator': 'REMOVE' ###cause an error
'operand': {
'xsi_type': 'Campaign',
'id': campaign_id,
'settings': {
'xsi_type': 'UniversalAppCampaignSetting',
'youtubeVideoMediaIds': video_ids
}
}
}]
Error summary: {'faultMessage': '[OperatorError.OPERATOR_NOT_SUPPORTED @
operations[0]]', 'requestId': '000581cb388671830ae9ee0f530ff774',
'serviceName': 'CampaignService', 'methodName': 'mutate', 'operations':
'1', 'responseTime': '189'}
Traceback (most recent call last):
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/googleads/common.py",
line 1382, in MakeSoapRequest
*packed_args, _soapheaders=soap_headers)['body']['rval']
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/zeep/proxy.py",
line 42, in __call__
self._op_name, args, kwargs)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/zeep/wsdl/bindings/soap.py",
line 132, in send
return self.process_reply(client, operation_obj, response)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/zeep/wsdl/bindings/soap.py",
line 194, in process_reply
return self.process_error(doc, operation)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/zeep/wsdl/bindings/soap.py",
line 299, in process_error
detail=fault_node.find('detail'))
zeep.exceptions.Fault: [OperatorError.OPERATOR_NOT_SUPPORTED @
operations[0]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/i.tirsky/PycharmProjects/googleadw/campaign_mutate.py", line
78, in <module>
res = camp.remove_media_ids()
File "/Users/i.tirsky/PycharmProjects/googleadw/campaign_mutate.py", line
46, in remove_media_ids
return self._update_media_data()
File "/Users/i.tirsky/PycharmProjects/googleadw/campaign_mutate.py", line
67, in _update_media_data
return
self.campaign_service.mutate(operations)['value'][0]['settings'][1]['youtubeVideoMediaIds']
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/googleads/common.py",
line 1394, in MakeSoapRequest
e.detail, errors=error_list, message=e.message)
googleads.errors.GoogleAdsServerFault:
[OperatorError.OPERATOR_NOT_SUPPORTED @ operations[0]]
Process finished with exit code 1
I think I can only update (add new video to list but not change the list)
this list via SET command but cant REMOVE any videos(
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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].
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/3280313b-e032-4ae8-89b0-042fc65bfe70%40googlegroups.com
<https://groups.google.com/d/msgid/adwords-api/3280313b-e032-4ae8-89b0-042fc65bfe70%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 [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].
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/00d12ili7g000000o2a9g6007b24sqz6smjcchm6so30c1g68qjcd9h%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.