Hello,

I'm currently trying to setup the CURL to download a report, since as far 
as I can tell, I cannot do that via the PHP lib itself (given that the only 
service I found for reports is the ReportDefinitionService which gets me 
the forms, not data and AdGroupCriterionService doesn't return info such as 
clicks, etc.
The code I'm using right now,

$reportDefinition = '<?xml version="1.0" encoding="UTF-8"?>
<reportDefinition xmlns="https://adwords.google.com/api/adwords/cm/v201609";>
  <selector>
    <fields>CampaignId</fields>
    <fields>AdGroupId</fields>
    <fields>Impressions</fields>
    <fields>Clicks</fields>
    <fields>Cost</fields>
    <predicates>
      <field>AdGroupStatus</field>
      <operator>IN</operator>
      <values>ENABLED</values>
      <values>PAUSED</values>
    </predicates>
  </selector>
  <reportName>Custom Adgroup Performance Report</reportName>
  <reportType>ADGROUP_PERFORMANCE_REPORT</reportType>
  <dateRangeType>LAST_7_DAYS</dateRangeType>
  <downloadFormat>CSV</downloadFormat>
</reportDefinition>';
$params = array("__rdxml" => $reportDefinition);
$httpHeaders = array('Authorization: Bearer 
oath2IGotWhileAuthorizingThePhpLib',
'developerToken: myDevToken',
'clientCustomerId: accIdUnderTestMCC',
'Content-Type: multipart/form-data;');

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
curl_setopt($curl, CURLOPT_HTTPHEADER, $httpHeaders);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$page = curl_exec($curl);
curl_close($curl);

400 is what I get all the time. FYI, I'm using the oath I got while I was 
setting up the php lib, the test dev token and the clientId of a dummy acc 
under a test MMC acc. Laravel on Valet.

While on the topic of pulling this data, is this the correct way? What I 
need to do is get stuff such as Keywords/Search terms/Ad extensions as well 
as their % served, clicks, CTR, avg. pos., etc and after banging my head 
against the lib wall, I wanted to try this.

Thanks upfront!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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].
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/5b2ea1ee-ad37-4f93-97c3-f4004d8854ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • CURL HTT... swsmeat
    • Re:... 'Sreelakshmi Sasidharan (AdWords API Team)' via AdWords API Forum
    • Re:... 'Sreelakshmi Sasidharan (AdWords API Team)' via AdWords API Forum
    • Re:... 'Sreelakshmi Sasidharan (AdWords API Team)' via AdWords API Forum

Reply via email to