I have a similar requirement . Can you please help me provide the steps or 
any blogs if you have published/referred for the same.

Regards,
Siva Ragula

On Wednesday, December 4, 2013 at 1:45:49 PM UTC+1, [email protected] 
wrote:
>
> I'm trying to access adwords API with the following code in salesforce:
>
> HttpResponse res = new HttpResponse();
> Http http = new Http();
> req.setEndpoint('
> https://adwords.google.com/api/adwords/reportdownload/v201309');
> req.setMethod('POST');
> req.setHeader('Authorization', 'Bearer 
> ya29.1.AADtN_XN5J-ld2VbjCwzwMdWgCf62FoJ5dhdw5LIDLO3hA_P6PkhE43w4jLDzKsg');
>         req.setHeader('developerToken', 'Ox80jWNwZ9jZa5175T-Q3A');
>         req.setHeader('clientCustomerId', '203-167-7812');
>         req.setHeader('returnMoneyInMicros', 'false');
>         req.setHeader('Content-type', 'application/x-www-form-urlencoded'); 
>        
>         
>         String body = '<reportDefinition xmlns="
> https://adwords.google.com/api/adwords/cm/v201309";>\n' + 
>         '<selector>\n' +
>     '<fields>CampaignId</fields>\n' +
>     '<fields>Id</fields>\n' +
>     '<fields>Impressions</fields>\n' +
>     '<fields>Clicks</fields>\n' +
>     '<fields>Cost</fields>\n' +
>         '<predicates>\n' + 
>       '<field>Status</field>\n' +
>       '<operator>IN</operator>\n' +
>       '<values>ENABLED</values>\n' +
>       '<values>PAUSED</values>\n' +
>     '</predicates>\n' +
>   '</selector>\n' +
>   '<reportName>test</reportName>\n' +
>   '<reportType>ADGROUP_PERFORMANCE_REPORT</reportType>\n' +
>   '<dateRangeType>LAST_7_DAYS</dateRangeType>\n' + 
>   '<downloadFormat>CSV</downloadFormat>\n' + 
> '</reportDefinition>\n';
>         req.setBody('__rdxml=' + EncodingUtil.urlEncode(body, 'UTF-8'));  
>         system.debug('AM --> body ' + req.getBody());
>
>         try {
>         res = http.send(req);         
>         System.debug(res.getBody());         
>    } catch(System.CalloutException e) {
>        System.debug('Callout error: '+ e);
>        System.debug(res.toString());
>    } 
>
>
> And I'm getting the following error:
> <?xml version="1.0" encoding="UTF-8" 
> standalone="yes"?><reportDownloadError><ApiError><type>AuthenticationError.OAUTH_TOKEN_INVALID</type><trigger>&lt;null&gt;</trigger><fieldPath></fieldPath></ApiError></reportDownloadError>
>
> The token is valid and new
>
> Please advise 
> Thanks
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/c273db80-7a4a-41cf-8518-4df58e2738c9%40googlegroups.com.

Reply via email to