public function apiGet($action, $data = [], $method = 'GET', $options = []) { return $this->httpRequest($action, $this->prepareJsonPayload($data), $method, $options); }
function get_all_lists() { require_once 'client/requires.php'; $client = new Sailthru_Client(get_option('sailthru_api_key'), get_option('sailthru_secret')); //@TODO: need to do an API call here //return array('426' => 'test'); //return array('pheonix', 'seed'); $lists = $client->apiGet('list', array()); $list_names = array(); foreach ($lists as $list) { if (is_array($list)) { foreach ($list as $list_name) { $list_names[] = $list_name['name']; } } } return $list_names; }