如何在Google Ads API中设置请求标头 [英] How to set request header in google ads api

查看:88
本文介绍了如何在Google Ads API中设置请求标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的经理帐户下的广告帐户提出预算.我有以下YAML文件:

I want to propose a budget for an ads account under my manager account. I have the following YAML file:

developer_token: 13245
login-customer-id: 1324567891
customer-id: 1324567891
user_agent:  13245
client_id: 13245
client_secret: 13245
refresh_token: 13245

当我尝试运行脚本时,出现此错误:

When i try to run my script, i get this error:

消息错误

"用户无权访问客户.注意:如果您要访问客户客户,则必须在"login-customer-id"标题中设置经理的客户ID.

"User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header.

这是我在示例python库中使用的代码:

This is the code that i use, from the example python library:

    try:
    account_budget_proposal_response = (
      account_budget_proposal_service.mutate_account_budget_proposal(
          customer_id, account_budget_proposal_operation))

推荐答案

问题出在您收到的错误消息中.这有点令人困惑,这也让我也感到困惑.

The problem is in the error message you received. It's a little confusing and it got me too.

对于您而言,以下两项是相同的:
login-customer-id:1324567891
客户编号:1324567891

In your case, both of the below are the same:
login-customer-id: 1324567891
customer-id: 1324567891

这些必须有所不同.
login-customer-id:<-在此处设置您的经理帐户的CID
customer-id:1324567891<--在此处设置要管理的实际Google Ads帐户的CID.

这篇关于如何在Google Ads API中设置请求标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆