0

我正在使用 Google Adwords API 测试帐户测试报告使用情况。我有以下代码来下载广告组效果报告

    ReportDefinition definition = new ReportDefinition()
    {
        reportName = "Adgroup Report",
        reportType = ReportDefinitionReportType.ADGROUP_PERFORMANCE_REPORT,
        downloadFormat = DownloadFormat.CSVFOREXCEL,
        dateRangeType = ReportDefinitionDateRangeType.YESTERDAY,
        selector = new Selector
        {
            fields = new string[] { "Clicks" }
        }
    };

    ReportUtilities utilities = new ReportUtilities(user) { ReportVersion = "v201206" };
    ClientReport report = utilities.DownloadClientReport(definition, reportPath);

我收到以下错误:

无效的 ReportDefinition Xml:cvc-complex-type.2.4.a:发现以元素“选择器”开头的无效内容。'{" https://adwords.google.com/api/adwords/cm/v201206 ":id, " https://adwords.google.com/api/adwords/cm/v201206 ":selector}' 之一是预期的。

我错过了什么?

4

1 回答 1

2

快速浏览一下,您的报告定义对我来说是正确的。但是,Adwords API 版本v201206已停用。尝试使用v201306并查看这是否会使错误消失。如果没有,请查看创建和发送的实际 XML。

于 2013-08-30T09:50:14.037 回答