Hi,Anash:
I have the same issue while trying to make call downloading the
SEARCH_QUERY_PERFORMANCE_REPORT Reports.
Here is the code:
public static void Run(AdWordsUser user, string fileName)
{
try
{
ReportDefinition def = new ReportDefinition();
def.reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT";
def.reportType =
ReportDefinitionReportType.SEARCH_QUERY_PERFORMANCE_REPORT;
def.downloadFormat = DownloadFormat.GZIPPED_CSV;
def.dateRangeType =
ReportDefinitionDateRangeType.LAST_7_DAYS;
Selector selector = new Selector();
selector.fields = new string[] { "AdGroupName" };
//"AdGroupId", "AdGroupName", "CampaignId", "CampaignName",
"ConversionValue", "Cost", "ConversionsManyPerClick", "DestinationUrl",
"KeywordId", "MatchType", "Query", "TotalConvValue"
def.selector = selector;
def.includeZeroImpressions = true;
string filePath =
"D:\\CSharp\\Web\\GoogleWebReport\\Test_File\\" + fileName;
ReportUtilities utilities = new ReportUtilities(user);
utilities.ReportVersion = "v201402";
utilities.DownloadClientReport(def, filePath);
Console.WriteLine("Data Fetched");
Console.ReadLine();
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
Console.ReadLine();
}
}
public static AdWordsUser GetAccount()
{
AdWordsUser user = new AdWordsUser();
(user.Config as AdWordsAppConfig).AuthorizationMethod =
AdWordsAuthorizationMethod.OAuth2;
(user.Config as AdWordsAppConfig).ClientCustomerId =
"*************";
(user.Config as AdWordsAppConfig).OAuth2ClientId =
"************";
(user.Config as AdWordsAppConfig).OAuth2ClientSecret =
"************";
(user.Config as AdWordsAppConfig).OAuth2RefreshToken =
"***********";
(user.Config as AdWordsAppConfig).DeveloperToken = "*******";
return user;
}
static void Main(string[] args)
{
try
{
Console.WriteLine("Now Code Begins");
Run(GetAccount(), "INSERT_FILE_NAME_HERE");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.ReadLine();
}
Console.WriteLine("Work Done");
Console.ReadLine();
}
At first,i thought any fields not exsit in the service fields really
and I checked them at
https://developers.google.com/adwords/api/docs/appendix/reports#search-query.It
turned out that things were all right.Then i deleted all the other fields
except the "AdGroupName" and was sure that fields were OK when the
exception popped up again.I took OAuth2 as
AuthenticationMethod(OAuth2ClientSecret ,OAuth2ClientId ,ClientCustomerId
all offered ) with test-MCC account.Can you help me?
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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].
For more options, visit https://groups.google.com/d/optout.