getNumberOfParameters(); $rparamcount = $fct->getNumberOfRequiredParameters(); $fct_params = $fct->getParameters(); } } $output = ""; if (getval("submitting", "") != "" && $api_function != "") { $output = ""; $query = "function=" . $api_function; foreach ($fct_params as $fparam) { $param_name = $fparam->getName(); $param_val = trim(getval($param_name, "")); if ($fparam->isOptional() && $param_val == "") { continue; } $query .= "&{$param_name}=" . urlencode($param_val); } $output .= "Query: " . $query . "\n\n"; $output .= "Response:\n"; $output .= execute_api_call($query, true); } ?>
getName(); $param_val = trim(getval($param_name, "")); if ($fparam->isOptional() && $param_val == "") { continue; } if (strpos(urlencode($param_val), '%') === false) { $query .= '&' . $param_name . '=' . $param_val; } else { $query .= '&' . $param_name . '=" . urlencode("' . addslashes($param_val) . '") . "'; } } ?>
<?php // Set the private API key for the user (from the user account page) and the user we're accessing the system as. $private_key = ""; $user = ; // Formulate the query $query = "user=" . $user . "&; // Sign the query using the private key $sign = hash("sha256", $private_key . $query); // Make the request and output the JSON results. $results = json_decode(file_get_contents("/api/?" . $query . "&sign=" . $sign)); print_r($results);
private_key=""; user=; query=; sign=$(echo -n "${private_key}${query}" | openssl dgst -sha256); curl -X POST "/api/?${query}&sign=$(echo ${sign} | sed 's/^.* //')"