echo '<div class="apitest">'; $ca = new CityApi(); $ca->debug = true; echo '<h1>metrics_create</h1>'; $args = array('name' => 'Drive Yugos', 'is_percent' => 'false', 'description' => 'The number of people who drive Yugos'); $ca->json = false; $results = $ca->metrics_create($args); $metricid = $results['id']; echo '<h2>Formatted JSON results: </h2>'; echo '<pre>'; echo format_json(json_encode($results)); echo '</pre>'; echo '<h1>metrics_update</h1>'; $args = array('name' => 'Drive Yugos!!', 'description' => 'The number of people who drive Yugos!!'); $ca->json = true; $results = $ca->metrics_update($metricid, $args); echo '<h2>Formatted JSON results: </h2>'; echo '<pre>'; echo format_json($results); echo '</pre>'; echo '<h1>metrics_destroy</h1>'; $ca->json = true; $results = $ca->metrics_destroy($metricid); echo '<h2>Formatted JSON results: </h2>'; echo '<pre>'; echo format_json($results); echo '</pre>'; ?> </body> </html>