<?php require '../vendor/autoload.php'; require '../src/SeatsioApiClient.php'; require '../config.php'; //instantiate API client $client = new SeatsioApiClient(Config::$secretKey); //execute API request $data = $client->copyChart(Config::$chartKey); //print response data echo '<pre>' . print_r($data, true) . '</pre>';
/** * Create copy of chart */ static function copyChart($data) { $test = new ApiTest('copyChart', 200, 'string'); $client = new SeatsioApiClient($data['secretKey']); try { //execute API call $test->responseData = $client->copyChart($data['chartKey']); } catch (Exception $e) { $test->error = true; $test->errorData = $e->getMessage(); } $test->request = $client->request; $test->code = $client->response->code; $test->type = gettype($test->responseData); return $test; }