Php adwords api报告<;触发器>;缺少客户信息</触发器>;

Php adwords api报告<;触发器>;缺少客户信息</触发器>;,php,yii2,google-ads-api,Php,Yii2,Google Ads Api,我正在努力获取我的活动的每日成本。 我使用这个文档 我也在使用php和Yii2。我有: 客户Id 客户端id 访问令牌 客户机密 刷新令牌 当我获得活动名称和Id时,那些客户Id、客户Id、客户机密就足够了,我获得活动时没有任何问题,但当我尝试获取报告时,出现了错误 string(581) "HTTP/1.1 400 Bad Request Content-Type: text/xml Date: Mon, 22 May 2017 10:31:52 GMT Expires: Mon, 22 Ma

我正在努力获取我的活动的每日成本。 我使用这个文档

我也在使用php和Yii2。我有:

客户Id

客户端id
访问令牌
客户机密

刷新令牌

当我获得活动名称和Id时,那些客户Id、客户Id、客户机密就足够了,我获得活动时没有任何问题,但当我尝试获取报告时,出现了错误

string(581) "HTTP/1.1 400 Bad Request
Content-Type: text/xml
Date: Mon, 22 May 2017 10:31:52 GMT
Expires: Mon, 22 May 2017 10:31:52 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Accept-Ranges: none
Vary: Accept-Encoding
Transfer-Encoding: chunked

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><reportDownloadError><ApiError><type>ReportDownloadError.INVALID_PARAMETER</type><trigger>Missing client information</trigger><fieldPath></fieldPath></ApiError></reportDownloadError>"
string(581)“HTTP/1.1400错误请求
内容类型:text/xml
日期:2017年5月22日星期一10:31:52 GMT
到期时间:2017年5月22日星期一10:31:52 GMT
缓存控制:专用,最大年龄=0
X-Content-Type-Options:nosniff
X-Frame-Options:SAMEORIGIN
X-XSS-保护:1;模式=块
伺服器:GSE
接受范围:无
改变:接受编码
传输编码:分块
ReportDownloadError.INVALID_参数缺少客户端信息“
也许我用curl做post请求是错误的,因为我可以毫无错误地获得活动。 这是我的密码

$ch = curl_init();

        curl_setopt($ch, CURLOPT_URL,"http://adwords.google.com/api/adwords/reportdownload/v201702");
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch,CURLOPT_HEADER,1);

$XML= <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<reportDefinition xmlns="https://adwords.google.com/api/adwords/cm/v201702">
    <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>TODAY</dateRangeType>
    <downloadFormat>CSV</downloadFormat>
</reportDefinition>
XML;

$headers = array("Content-Type:multipart/form-data",
 "Authorization"=> "Bearer my_access_token",
  "developerToken" => "my_developer_token",
 "clientCustomerId"=> 111-111-1111, // test account

); 

$postfields = array("__rdxml" =>$XML );
        curl_setopt($ch, CURLOPT_HTTPHEADER , $headers);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);


 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        $server_output = curl_exec ($ch);
 echo "<pre>";
var_dump($server_output);
echo "</pre>";
        curl_close ($ch);
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,”http://adwords.google.com/api/adwords/reportdownload/v201702");
卷曲设置($ch,卷曲设置桩,1);
curl_setopt($ch,CURLOPT_头,1);
$XML=111-111-1111,//测试帐户
); 
$postfields=array(“\urdxml”=>$XML);
curl_setopt($ch,CURLOPT_HTTPHEADER,$headers);
curl_setopt($ch,CURLOPT_POSTFIELDS,$POSTFIELDS);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$server\u output=curl\u exec($ch);
回声“;
变量转储(服务器输出);
回声“;
卷曲关闭($ch);

结果是我生成了错误的访问令牌。当我像这里描述的那样生成它时
一切顺利。

结果是我生成了错误的访问令牌。当我像这里描述的那样生成它时 一切顺利