LabelService xsi:type

99 views
Skip to first unread message

Toms Mārtiņš Sīmanis

unread,
May 24, 2017, 10:32:57 AM5/24/17
to AdWords API Forum
Hello!

I want to create automatized tools for AdWords and I have a problem with understanding of, what is xsi:type?


 label_service = AdWordsClient.GetService('LabelService', version='v201702')
operations = [{
'operator': 'ADD',
'operand': {
'name': CampLab,
},
'settings': [
{
'xsi_type': 'CONTENT_LABEL'
}
]
}]
labels = label_service.mutate(operations)

Variable CampLab is inherited from another function, but the problematic place I have is "xsi_type", I haven't found any information on what that might be!

suds.TypeNotFound: Type not found: 'ns0:CONTENT_LABEL'

This is the error I recieve.
Btw, I am doing this in python.

Toms Martins Simanis

Sreelakshmi Sasidharan (AdWords API Team)

unread,
May 24, 2017, 2:12:46 PM5/24/17
to AdWords API Forum
Hi Toms,

If you have elements in your XML file whose type is a complex type, xsi:type specifies the particular complex type. Are you trying to add a Label or a Content Label? If you are trying to add a content label, you will need to use AdGroupCriterionService or the CampaignCriterionService. If you are trying to add a Label, the xsi_type should be 'TextLabel'. The xsi_type can be found out from the Production WSDL listed under corresponding service.

Let me know if you have any further questions.

Thanks,
Sreelakshmi, AdWords API Team

Toms Mārtiņš Sīmanis

unread,
May 25, 2017, 1:53:02 AM5/25/17
to AdWords API Forum
Thank you, the second thing about xsi_type being 'TextLabel' was the answer.
Reply all
Reply to author
Forward
0 new messages