如何在Google Ads API中设置请求标头

问题描述

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

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

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

消息错误

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

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

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

解决方法

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

在您的情况下,以下两项相同:
login-customer-id:1324567891
客户编号:1324567891

这些必须有所不同。
login-customer-id: customer-id:1324567891