2017-06-14 54 views
1

我試圖在Doubleclick Bid Manager中創建一個新查詢,但我得到的只是「500內部服務器錯誤」(https://developers.google.com/bid-manager/v1/queries/createquery)。創建新查詢時出現問題DoubleClick Bid Manager

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

有人可以幫我一個請求查詢的例子嗎?謝謝!

回答

0

完成!以下代碼有效。

代碼的請求:

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 Request: 

    { 
     "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" 
      } 
     ] 
     } 
    } 

還是要謝謝你!