Monday, 18 January 2016

ReportDefinitionError.CUSTOMER_SERVING_TYPE_REPORT_MISMATCH

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.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
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 adwords-api+unsubscribe@googlegroups.com.
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/ab56828e-718b-4c7b-8793-8cf6b77b85ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment