We created an API which creates an AD_PERFORMANCE_REPORT for the last day in XML format. Running it with the token with our test-account, everything works as it should. So today our token got approved for the acctual account (Login is MCC).
So we changed the Login data accordingly in the app.config. So login works all OK, but when it tries to get the report we now get the following error:
"Customer can not create report of a selected type.. (Error: ReportDefinitionError.CUSTOMER_SERVING_TYPE_REPORT_MISMATCH, FieldPath: selector, Trigger: )"
So what does this mean, and how can this be fixed?
Here is the code we are running:
public static XmlDocument GetReport(AdWordsUser user, string fileName = "")
{
ReportDefinition definition = new ReportDefinition()
{
reportName = "AD_PERFORMANCE_REPORT",
reportType = ReportDefinitionReportType.AD_PERFORMANCE_REPORT,
downloadFormat = DownloadFormat.XML,
dateRangeType = ReportDefinitionDateRangeType.YESTERDAY,
selector = new Selector()
{
fields = new string[] { "Id", "Headline", "Description1", "Description2", "DisplayUrl", "Impressions", "Clicks", "Cost", "Ctr", "Status" },
predicates = new Predicate[] { Predicate.In("Status", new string[] { "ENABLED", "PAUSED", "DISABLED" }) }
},
// Optional: Include zero impression rows.
includeZeroImpressions = true
};
try
{
ReportUtilities utilities = new ReportUtilities(user, "v201509", definition);
XmlDocument doc = new XmlDocument();
using (ReportResponse response = utilities.GetResponse())
{
if (fileName != "")
{
string filePath = Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Temp\" + fileName;
response.Save(filePath);
}
else
{
StreamReader stream = new StreamReader(response.Stream);
doc.PreserveWhitespace = true;
doc.Load(stream);
}
}
return doc;
}
catch (Exception ex)
{
FileLogger.HandleError("", false, true, "Error (ReportHandle, GetReport): " + Environment.NewLine + ex.Message, App._LogFilePath, App._LogFileName);
return null;
}
}
Since the code works on the Test account, It can't really be some code error. So it must be with the Google token access. Do we need to apply for more access???
Any help appreciated.