Hi,
        -- Could you elaborate on why you are not using the reporting utility in the .NET client library, as shown in the DownloadCriteriaReport example? That will handle setting all of the necessary headers, etc. All you have to do is configure your App.config file as specified in the App.config sample in the library, and the library will take care of exchanging your refresh token for an access token, as well as properly setting up the HTTP request for reports.
Thanks,
Josh, AdWords API Team
On Friday, April 29, 2016 at 9:05:55 AM UTC-4, radley.anaya@kellybrady.com wrote:
On Friday, April 29, 2016 at 9:05:55 AM UTC-4, radley.anaya@kellybrady.com wrote:
I keep getting this error"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><reportDownloadError><ApiError> <type>AuthenticationError.NOT_ ADS_USER</type><trigger>< null></trigger><fieldPath>< /fieldPath></ApiError></ reportDownloadError>" 
I know this error means:Reason NOT_ADS_USERSummary The login used to generate the access token is not associated with any AdWords account. Common causes The login information provided corresponds to a Google account that does not have AdWords enabled.  The problem is that I am able to use these same credentials in the C# sample asp.net application and get authenticated.Why would these credentials work in one instance but not this instance?Here is my code:using RestSharp;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace GoogleAdWordsReportPuller{class FileGrabber{string reportDefinition = @"<reportDefinition xmlns=""https://adwords.google.com/api/adwords/cm/ "">v201603 <selector><fields>AdGroupName</fields><fields>Date</fields><fields>AdGroupStatus</fields><fields>CampaignName</fields><fields>Impressions</fields><fields>Clicks</fields><fields>Conversions</fields><fields>Cost</fields></selector><reportName>Custom Adgroup Performance Report</reportName><reportType>ADGROUP_PERFORMANCE_REPORT</ reportType> <dateRangeType>YESTERDAY</dateRangeType> <downloadFormat>CSV</downloadFormat> </reportDefinition>";string developerToken = "xxxxxxxxxxxxx";string clientId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent. ";com string accessToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx"; // actually a refresh token string accountId = "585-353-4323"; // client account idstring clientUrl = "https://adwords.google.com/api/adwords/reportdownload/ ";v201603 public void GetReport(){//Host: adwords.google.com//User-Agent: curl, gzip//Accept: */*//Accept-Encoding: gzip//Authorization: Bearer [Enter OAuth 2.0 access token here]//developerToken: [Enter developerToken here]//clientCustomerId: [Enter clientCustomerID here]//Content-Length: 784//Expect: 100-continue//Content-Type: multipart/form-data; boundary=------------------------12d01fae60c7b559 var client = new RestClient(clientUrl);var request = new RestRequest(Method.POST);// set http headersrequest.AddHeader("Host", "adwords.google.com");request.AddHeader("User-Agent", "curl, gzip"); request.AddHeader("Accept", "*/*");request.AddHeader("Accept-Encoding", "gzip"); request.AddHeader("Authorization", accessToken); // tried request.AddHeader(" Authorization", "Bearer " + accessToken); request.AddHeader("developerToken", developerToken); request.AddHeader("clientCustomerId", accountId); request.AddHeader("Content-Length", "784"); //request.AddHeader("Expect", "100-continue");request.AddHeader("Content-Type", "multipart/form-data; boundary=--------------------- ---12d01fae60c7b559"); //set request parametersrequest.AddParameter("__rdxml", reportDefinition); // adds to POST or URL querystring based on Method // execute the requestIRestResponse response = client.Execute(request);var content = response.Content; // raw content as string}}}I'm wondering if I need an access token instead because according to the documentation: https://developers.google.com/adwords/ api/docs/guides/reporting# complete-example The http header has a field that says:POST /api/adwords/reportdownload/v201601 HTTP/1.1 Host: adwords.google.com User-Agent: curl, gzip Accept: */* Accept-Encoding: gzip Authorization: Bearer [Enter OAuth 2.0 access token here] developerToken: [Enter developerToken here] clientCustomerId: [Enter clientCustomerID here] Content-Length: 784 Expect: 100-continue Content-Type: multipart/form-data; boundary=------------------------12d01fae60c7b559 
Can anyone help me?Thanks
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/3683077f-0339-4248-a136-226332b5f479%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment