1

我正在尝试在 Doubleclick Bid Manager 中创建一个新查询,但我得到的只是“500 内部服务器错误”(https://developers.google.com/bid-manager/v1/queries/createquery)。

QueryMetadata metadata = new QueryMetadata();
String tiempo = "LAST_14_DAYS";
metadata.setTitle("June");
metadata.setFormat("CSV");
metadata.setDataRange("PREVIOUS_WEEK");

Query queryTest = new Query();
queryTest.setMetadata(metadata);

Query tres = service.queries().createquery(queryTest).execute();

有人可以帮助我请求查询示例吗?谢谢!

4

1 回答 1

1

以下代码有效。

代码请求:

QueryMetadata metadata = new QueryMetadata();
String tiempo = "LAST_14_DAYS";
metadata.setTitle("June");
metadata.setFormat("CSV");
metadata.setDataRange("MONTH_TO_DATE");

List<FilterPair> prueba = new ArrayList<>();
FilterPair filter = new FilterPair();
filter.setType("FILTER_ADVERTISER");
prueba.add(filter);

Parameters parameter = new Parameters();
parameter.setType("TYPE_GENERAL");
parameter.setFilters(prueba);

QuerySchedule schedule = new QuerySchedule();

schedule.setFrequency("DAILY");

Query queryTest = new Query();
queryTest.setMetadata(metadata);
queryTest.setParams(parameter);
queryTest.setSchedule(schedule);

Query tres = service.queries().createquery(queryTest).execute();

JSON 正文:

{
  "kind": "doubleclickbidmanager#query",
  "metadata": {
    "dataRange": "MONTH_TO_DATE",
    "format": "CSV",
    "title": "test"
  },
  "queryId": "1322322",
  "schedule": {
    "frequency": "DAILY"
  },
  "params": {
    "metrics": [
      "METRIC_IMPRESSIONS",
    ],
    "type": "TYPE_GENERAL",
    "filters": [
      {
        "type": "FILTER_ADVERTISER"
      }
    ]
  }
}
于 2017-06-14T08:45:28.283 回答