创建新查询DoubleClick Bid Manager时遇到问题-Python

时间:2020-02-10 14:07:07

标签: python google-apis-explorer google-ad-manager

dict = {
    "kind": "doubleclickbidmanager#query",
    "metadata": {
        "dataRange": "LAST_30_DAYS",
        "format": "CSV",
        "title": "test API"
    },
    "params": {
        "filters": [
        {
            "type": "FILTER_PARTNER",
            "value": "Nestle (GCC&Levant)_PM MENA (2410734)"
        }
        ],
        "metrics": [
        "METRIC_CLICKS",
        "METRIC_UNIQUE_REACH_CLICK_REACH",
        "METRIC_UNIQUE_REACH_IMPRESSION_REACH"
        ]
    }
}

r = requests.post('https://www.googleapis.com/doubleclickbidmanager/v1.1/query',data = dict)

这是我尝试用于在Google出价管理器上创建用于脱机报告查询的代码。 它给了我以下错误

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Login Required",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Login Required"
 }
}

我尝试了不同的方法,甚至尝试使用请求类型调用,并将授权密钥放入API调用中,但这没有用。肯定有人丢失了吗?

1 个答案:

答案 0 :(得分:0)

您可以按照以下python示例进行登录:https://github.com/googleads/googleads-bidmanager-examples/tree/master/python

但是无论如何,登录后总有问题,我在下面发布了另一个问题:HttpEroor 500 Backend Error and HttpError 403 using DoubleClick Bid Manager API in python