Connecting with a specific clientCustomerId

34 views
Skip to first unread message

Roberto

unread,
Jan 24, 2020, 9:59:31 AM1/24/20
to AdWords API and Google Ads API Forum
Hi, I'm using API to connect with api.properties that has data for MCC account,
i want to create a session for a managed clientCustomerId to add campaigns etc.
What call i should use without changing ads.properties,
where i put clientCustomerId into the:

   Credential oAuth2Credential = new OfflineCredentials.Builder()
              .forApi(Api.ADWORDS)

              .fromFile()

              .build()

              .generateCredential();

 


or is another metod to call?

thanks,
Roberto

Google Ads API Forum Advisor Prod

unread,
Jan 24, 2020, 3:20:20 PM1/24/20
to ilmio...@gmail.com, adwor...@googlegroups.com
Hello Roberto,

You can add the following line to specify your client customer ID:

AdWordsSession session =
          new AdWordsSession.Builder().fromFile().withClientCustomerId("INSERT HERE").withOAuth2Credential(oAuth2Credential).build();

Cheers,
Anthony
Google Ads API Team

ref:_00D1U1174p._5001USwxip:ref
Reply all
Reply to author
Forward
0 new messages