Hi Matthias,
I went to check this out, as I think I need to do this for my issue.
I was able to get the parent criterion id using the AdGroupCriterionService get selector
Looks like something like this would work - but I've not put it in practice other than a quick test.
def main(client, adgroup_id):
"""Runs the example."""
adgroup_criterion_service = client.GetService(
'AdGroupCriterionService', version='v201806')
selector = {
'fields':['ParentCriterionId'],
'predicates':[
{
'field':'AdGroupId',
'operator': 'EQUALS',
'values': adgroup_id
}
]
}
page = adgroup_criterion_service.get(selector)
print page['entries'][0]['criterion']['id']
It appears that the root partition is the first entry in the list so you can grab it using [0]. You should be able to confirm it - as the page['entries'][0]['criterion']['idparentcriterionId] should be None.