Esempio n. 1
0
 public function aggregateStatistics($api_token, $metrics = null, $group_by = null, $start_date = null, $end_date = null, $sub_account = null)
 {
     $query_dict = $this->_initAccessReqDict($api_token);
     if ($metrics != null) {
         $query_dict["metrics"] = json_encode($metrics);
     }
     if ($group_by != null) {
         $query_dict["group_by"] = $group_by;
     }
     if ($start_date != null) {
         $query_dict["start_date"] = $start_date;
     }
     if ($end_date != null) {
         $query_dict["end_date"] = $end_date;
     }
     if ($sub_account != null) {
         // account_id parameter named subAccount for clarity
         $query_dict["account_id"] = $sub_account;
     }
     return WebUtils::getJson($this->BASE_URL, Actions::AGGREGATE_STATISTICS_PATH, "GET", WebUtils::BASIC_TIMEOUT, $query_dict);
 }