Hi,

I'm not a Google Apps Script expert, but it seems that you aren't placing 
your request parameters under the *payload* parameter as shown in the *Advanced 
parameters* table under fetch(String,Object) 
<https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app?csw=1#fetch(String,Object)>
.

Cheers,
Josh, AdWords API Team

On Sunday, June 8, 2014 12:34:35 PM UTC-4, Jeff Siebach wrote:
>
> Hello,
>
> I am trying to query the AdWords reporting API using the following Google 
> Scripts code:
>
>   var params = {
>     headers: {
>     Authorization: 'Bearer ___ACCESS_TOKEN___',
>     developerToken: '___DEVELOPER_TOKEN___',
>     clientCustomerId: '___CUSTOMER_ID_XXXXXXXXXX___'
>           },
>     muteHttpExceptions: true,
>     '__rdquery' : 'SELECT CampaignName FROM CAMPAIGN_PERFORMANCE_REPORT 
> DURING LAST_7_DAYS',
>     '__fmt' : 'CSV',
>     method:'post'
>   }
>   var url = "https://adwords.google.com/api/adwords/reportdownload/v201402
> ";
>   Logger.log(params)
>   Logger.log(UrlFetchApp.fetch(url, params))
> }
>
> The response I get is:
>
> <?xml version="1.0" encoding="UTF-8" 
> standalone="yes"?><reportDownloadError><ApiError><type>ReportDownloadError.MISSING_PARAMETER</type><trigger>Missing
>  
> report 
> definition</trigger><fieldPath></fieldPath></ApiError></reportDownloadError>
>
> I have tried defining the reports in a number of different ways:
>
> With and without + between the words of __rdquery, as it is shown here: 
> https://groups.google.com/forum/#!msg/adwords-api/TzvGZxsTIOg/gdhT8WZIg7YJ
> I have tried with and without URL encoding for the __rdquery and for the 
> authorization token.
>
> Could this be an error with my authorization?  Or am I failing to define 
> my request correctly?  
>
> I could not find a client library with any existing code that works in 
> Google Scripts.  If there is a resource I could review for accessing the 
> AdWords API using the UrlFetchApp I would be really appreciative.
>
> Thank you
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.

Reply via email to