当前位置: 首页 > 知识库问答 >
问题:

adwords api报告缺少客户端信息

郑光济
2023-03-14

我想知道我竞选活动的日常费用。我用这个留档https://developers.google.com/adwords/api/docs/guides/reporting

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

客户ID

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

刷新令牌

当我得到活动名称和id,这些客户客户ID,客户ID,client_secret就足够了,我得到活动没有任何问题,但当我试图得到一个报告,有错误

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>"

也许我用curl发帖子的请求是错误的,因为我可以毫无错误地获得活动。这是我的密码

$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);

共有1个答案

麻茂材
2023-03-14

结果是我生成了错误的访问令牌。当我像这里描述的那样生成它时https://developers.google.com/identity/protocols/OAuth2WebServer#incrementalAuth一切顺利。

 类似资料:
  • 我已经安装Kibana版本6.5。我选择了30天免费试用,并启用了x-pack安全选项。 通过KibanaUI我创建了一个用户并分配了报告所需的两个角色-kibana_user和reporting_user。现在我通过这个新用户登录,但在仪表板上找不到报告选项。 即使我使用具有超级用户角色的elastic用户登录,行为也是一样的。我错过什么了吗? 我在Kibana startup上看到一条日志,上

  • 我正在尝试从我的Java代码生成Jasper报告,我的Java应用程序是Swing。我使用设计了Jasper报告。然而,在我的报告中,有一个徽标图像。图像位置是动态传递的,在Jaspesoft Studio上预览时效果良好。以下是JasperSoft工作室中的图像设置。变量是 这就是我用Java生成报告的方式。 问题是,Java生成的报表没有图像!这是怎么了? 更新 我也尝试将用作,但这里有相同的

  • 安装详细信息: 包:面向Web开发人员的Eclipse Java EE IDE。 版本:Luna发行版(4.4.0)

  • 我在Quarkus/穆特尼(反应性)中有一个基本的实现,并且能够使用工件小黑麦-穆特尼-vertx-web-Client使用REST应用编程接口。当我使用穆特尼时,Vertx是从io.vertx.mutiny.core.Vertx导入的。我没有发现兼容的Vertx穆特尼OAuth2库。工件vertx-auth-oAuth2(这里描述)似乎只支持裸Vert. x。 有OAuth2支持Vertx叛变吗

  • 问题内容: 您好,我正在尝试构建一个使用Thrift查询我的Hive数据库的nodejs客户端,但是我面临一个奇怪的问题…我已经用Thrift 生成了我的nodejs客户端API(TCLIService是定义Hive服务的Thrift文件)现在我尝试连接到Hive,但是我的OpenSession正在等待中……也许我没有进行正确的呼叫,但是我在网上找不到任何最新消息(每个节俭/节点/ hive项目都

  • 功能介绍 获取信息流分析报告数据,包括表格详情数据与趋势数据,所获取数据与 https://mtj.baidu.com 中报告数据一致 接口 https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey 此处仅列本接口特有参数,公共参数请参考报告级API说明 获取总计数据 参数名 参数类型 是否必须 描述 method string 是