private function AddContact() { // Cross validation if the request method is GET else it will return "Not Acceptable" status if ($this->get_request_method() != "POST") { $this->response('not a post', 406); } // RSR TODO: need to check for all parameters not just group_id! if (!isset($_REQUEST["group_id"])) { $this->response('no group_id', 406); } else { $name = $this->_request["name"]; $email = $this->_request["email"]; } $dal = new DAL(); $alertId = $dal->AddAlert($groupId, $name, $expression); $dal = null; $alert = new stdClass(); $alert->alert_id = $alertId; $this->response($this->json($alert), 200); }