How to access Adwords API without a developer key using Java?

92 views
Skip to first unread message

vmud...@google.com

unread,
Aug 22, 2017, 11:41:27 PM8/22/17
to AdWords API Forum
Hi,

I'm developing an automation tool which requires access to adwords account. I've gone through several blogs to access adwords API using java which says that a developer token is required for that. For that I need to create am mcc account it seems which I couldn't. So, please let me know, how to access adwords API to pull some reports using Java.

Here is the sample code that I'm using.

// Construct an AdWordsSession.
   AdWordsSession session = new AdWordsSession.Builder()
    .withClientCustomerId(clientCustomerId)
    .fromFile()
       .withClientCustomerId(clientCustomerId)
       .withOAuth2Credential(oAuth2Credential)
       .build();

ReportingConfiguration reportingConfiguration =
       new ReportingConfiguration.Builder()
           // Skip all header and summary lines since the loop below expects
           // every field to be present in each line.
           .skipReportHeader(true)
           .skipColumnHeader(true)
           .skipReportSummary(true)
           // Enable to include rows with zero impressions.
           .includeZeroImpressions(false)
           .build();
   session.setReportingConfiguration(reportingConfiguration);

   ReportDownloaderInterface reportDownloader =
       adWordsServices.getUtility(session, ReportDownloaderInterface.class);

Note: I have a client_id, client_secret and a refreshToken.


Appreciate your help in this.

Vincent Racaza (AdWords API Team)

unread,
Aug 23, 2017, 1:21:44 AM8/23/17
to AdWords API Forum
Hi Venkata,

Yes, you need a developer token with basic/standard access to target an AdWords production account. If you are targeting a test account only, you can use a developer token with test account access. You may refer here for more information regarding access levels of the developer token.

Also, you cannot use the AdWords API without a developer token. If you currently have an access to an AdWords account only, not an MCC account, then you can check with the owners of the AdWords account if the parent MCC has a developer token already. If it has a token already, then you can use that developer token to target your AdWords account. If not, then you/your client needs to apply for Basic access to get your developer token.

Thanks,
Vincent
AdWords API Team
Reply all
Reply to author
Forward
0 new messages