How to set request header in google ads api

…衆ロ難τιáo~ 提交于 2021-01-29 17:28:41

问题


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:

Error with message

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

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

回答1:


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

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

These need to be different.
login-customer-id: <- Set the CID of your Manager Account here
customer-id: 1324567891 <- Set the CID of the actual Google Ads Account you want to manage here.



来源:https://stackoverflow.com/questions/63445982/how-to-set-request-header-in-google-ads-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!