You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My question is regarding the 'fields': ['CustomerId'] below for a ManagedCustomerService service object. The documentation shows uncapitalized customerId as the string but the below code only works when it's capitalized CustomerId. Is the documentation I'm looking at no relevant to Python? Also, is there a way to check programmatically what the options are via the API?
Thanks
import logging
import sys
import webbrowser
import os
import yaml
from googleads import adwords, oauth2
from io import StringIO
from oauth2client import client
import time
import datetime
import codecs
PATH = os.getcwd()+'\\googleads.yaml'
# open the yaml file to get credentials from it
with open(PATH, 'r') as f:
# yaml_data is a json-like nested dict - first key is "adwords"
yaml_data = yaml.safe_load(f.read())
# for each key in the yaml_data
for yaml_key in yaml_data:
# get credentials related to each key
auth_data = yaml_data.get(yaml_key)
# use auth_data to create an oauth client
oauth2_client = oauth2.GoogleRefreshTokenClient(
auth_data['client_id'],
auth_data['client_secret'],
auth_data['refresh_token']
)
# use the oauth2_client created above as a parameter to make an adwords_client
adwords_client = adwords.AdWordsClient(
auth_data['developer_token'],
oauth2_client,
auth_data['user_agent'],
client_customer_id = auth_data['client_customer_id']
)
# creates a service object using the adwords_client to create a managed service object
managed_customer_service = adwords_client.GetService(
'ManagedCustomerService', version='v201607')
# CustomerId NEEDS to be capitalized even though documentation shows otherwise
mcc_accounts = managed_customer_service.get(
{'fields': ['CustomerId'],
'predicates': [{
'field': 'CanManageClients',
'operator': 'NOT_EQUALS',
'values': True
}]
})
The text was updated successfully, but these errors were encountered:
My question is regarding the
'fields': ['CustomerId']
below for aManagedCustomerService
service object. The documentation shows uncapitalizedcustomerId
as the string but the below code only works when it's capitalizedCustomerId
. Is the documentation I'm looking at no relevant to Python? Also, is there a way to check programmatically what the options are via the API?Thanks
The text was updated successfully, but these errors were encountered: