Hi there,

I think I've hit a bug. The first line of output for the attached class is:
Ad group ID,Ad group

even though I set useRawEnumValues(true) in the ReportingConfiguration. I 
would have expected the output to be:
AdGroupId, AdGroupName

Is this a bug or have I missed something?

Best regards,

Gary

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/0a677167-9dd6-410c-ad8a-c23c810ab6e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
import java.util.Arrays;

import com.google.api.ads.adwords.lib.client.AdWordsSession;
import com.google.api.ads.adwords.lib.client.AdWordsSession.ImmutableAdWordsSession;
import com.google.api.ads.adwords.lib.client.reporting.ReportingConfiguration;
import com.google.api.ads.adwords.lib.jaxb.v201609.DateRange;
import com.google.api.ads.adwords.lib.jaxb.v201609.DownloadFormat;
import com.google.api.ads.adwords.lib.jaxb.v201609.PredicateOperator;
import com.google.api.ads.adwords.lib.jaxb.v201609.ReportDefinition;
import com.google.api.ads.adwords.lib.jaxb.v201609.ReportDefinitionDateRangeType;
import com.google.api.ads.adwords.lib.jaxb.v201609.ReportDefinitionReportType;
import com.google.api.ads.adwords.lib.utils.ReportDownloadResponse;
import com.google.api.ads.adwords.lib.utils.v201609.ReportDownloader;
import com.google.api.ads.common.lib.auth.OfflineCredentials;
import com.google.api.ads.common.lib.auth.OfflineCredentials.Api;
import com.google.api.client.auth.oauth2.Credential;
import com.nosto.ads.google.report.Report;

public final class ReportDownloaderTest {

    private static final String DEVELOPER_TOKEN = "REDACTED";
    private static final String USER_AGENT = "REDACTED";
    private static final String CLIENT_CUSTOMER_ID = "REDACTED";
    private static final String CLIENT_ID = "REDACTED";
    private static final String CLIENT_SECRET = "REDACTED";
    private static final String REFRESH_TOKEN = "REDACTED";

    private ReportDownloaderTest() {}

    public static void main(String[] args) throws Exception {

        Credential oAuth2Credential = new OfflineCredentials.Builder().forApi(Api.ADWORDS)
                .withClientSecrets(CLIENT_ID, CLIENT_SECRET)
                .withRefreshToken(REFRESH_TOKEN)
                .build()
                .generateCredential();

        ImmutableAdWordsSession session = new AdWordsSession.Builder()
                .withDeveloperToken(DEVELOPER_TOKEN)
                .withUserAgent(USER_AGENT)
                .withOAuth2Credential(oAuth2Credential)
                .withClientCustomerId(CLIENT_CUSTOMER_ID)
                .buildImmutable();

        DateRange dateRange = new DateRange();
        dateRange.setMin("20170201");
        dateRange.setMax("20170202");

        ReportDefinition reportDefinition = new Report.DefinitionBuilder()
                .name("Shopping Performance Report")
                .type(ReportDefinitionReportType.SHOPPING_PERFORMANCE_REPORT)
                .dateRangeType(ReportDefinitionDateRangeType.CUSTOM_DATE)
                .dateRange(dateRange)
                .fields("AdGroupId", "AdGroupName")
                .predicate("CampaignStatus", PredicateOperator.NOT_EQUALS, "REMOVED")
                .downloadFormat(DownloadFormat.CSV)
                .build();

        ReportingConfiguration reportingConfiguration = new ReportingConfiguration.Builder()
                .includeZeroImpressions(false)
                .skipColumnHeader(false)
                .skipReportHeader(true)
                .skipReportSummary(true)
                .useRawEnumValues(true)
                .build();

        ImmutableAdWordsSession reportSession = session.newBuilder()
                .withReportingConfiguration(reportingConfiguration)
                .buildImmutable();

        ReportDownloadResponse reportDownloadResponse = new ReportDownloader(reportSession)
                .downloadReport(reportDefinition);

        System.out.println(reportDownloadResponse.getAsString());
    }
}
  • useRawEnumValue... Gary Madden

Reply via email to