AdWords
1.9K members online now
1.9K members online now
Dive into advanced features like Remarketing, Flexible Bid Strategies, AdWords Editor, and AdWords Scripts
Guide Me
star_border
Reply

Error 404 - Bad Request

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello.  We are using a C# application to retrieve report information from the Report API and it has been working fine for 3 months.  On June 13 it stopped working when making the request.  The error message is "Error 404 Bad Request".

 

I downloaded the sample application from the API website and ran the code using my authentication credentials and got the same error message.

 

I am able to authenticate and get a token.  The error occurs when calling

"HttpWebResponse Response = (HttpWebResponse)Request.GetResponse();"

 

Here is the supporting code

 

string RequestPacket =
"<reportDefinition>" +
"<selector>" +
"<fields>CampaignName</fields>" +
"<fields>Name</fields>" +
"<fields>Date</fields>" +
"<fields>Impressions</fields>" +
"<fields>Clicks</fields>" +
"<fields>Cost</fields>" +
"<dateRange>" +
"<min>20120613</min>" +
"<max>20120628</max>" +
"</dateRange>" +
"</selector>" +
"<reportName>Adgroup_Performance_Report</reportName>" +
"<reportType>ADGROUP_PERFORMANCE_REPORT</reportType>" +
"<dateRangeType>CUSTOM_DATE</dateRangeType>" +
"<downloadFormat>XML</downloadFormat>" +
"</reportDefinition>";

 

WebRequest Request = HttpWebRequest.Create("https://adwords.google.com/api/adwords/reportdownload/v201109");
Request.Headers.Add("clientCustomerId: " + ClientCustomerId);
Request.Headers.Add("developerToken: " + DeveloperToken);
Request.Headers.Add("Authorization: GoogleLogin auth=" + AuthToken);
Request.Headers.Add("returnMoneyInMicros: false");
Request.Method = "POST";
Request.ContentType = "application/x-www-form-urlencoded";
using (StreamWriter writer = new StreamWriter(Request.GetRequestStream()))
{
writer.Write("__rdxml=" + HttpUtility.UrlEncode(RequestPacket));
}

HttpWebResponse Response = (HttpWebResponse)Request.GetResponse();

 

The last line is when the error occurs.

 

Thank you in advance,

Vince

1 Expert replyverified_user

Re: Error 404 - Bad Request

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭
Some more information. The error message in teh response says.
"Unable to locate billing information for that Developer Token" But when I look at the status of the token it is set to "Approved".
Marked as Best Answer.
Solution
Accepted by Zee (Community Manager)
September 2015

Re: Error 404 - Bad Request

Top Contributor
# 3
Top Contributor

Hello reveal ; welcome;

The best would be to post your question at the AdWords API forum:

 

https://groups.google.com/forum/?fromgroups#!forum/adwords-api

 

Moshe, AdWords Top Contributor , Twitter | Linkedin | Community Profile | Ad-Globe
Did you find any helpful responses or answers to your query? If yes, please mark it as the ‘Best Answer’