'string', 'api_key' => 'string')); civiproxy_map_site_key($credentials, $sys_key_map); civiproxy_map_api_key($credentials, $api_key_map); // check if the call itself is allowed $action = civiproxy_get_parameters(array('entity' => 'string', 'action' => 'string', 'version' => 'int', 'json' => 'int', 'sequential' => 'int')); if (!isset($action['version']) || $action['version'] != 3) { civiproxy_rest_error("API 'version' information missing."); } $valid_parameters= civiproxy_get_valid_parameters($action, $rest_allowed_actions); // extract parameters and add credentials and action data $parameters = civiproxy_get_parameters($valid_parameters); foreach ($credentials as $key => $value) { $parameters[$key] = $value; } foreach ($action as $key => $value) { $parameters[$key] = $value; } // evaluate the JSON parameter global $rest_evaluate_json_parameter; if ($rest_evaluate_json_parameter) { if (isset($_REQUEST['json'])) { $json_data = json_decode($_REQUEST['json'], true); if (!empty($json_data) && is_array($json_data)) { $json_parameters = civiproxy_get_parameters($valid_parameters, $json_data); $parameters['json'] = json_encode($json_parameters); } } } // finally execute query civiproxy_log($target_rest); civiproxy_redirect($target_rest, $parameters);