$api_key, 'secret' => $api_secret, 'scope' => 'active', 'limit' => 50 ]; $query = http_build_query($params); $signature = hash_hmac('sha256', $api_version . $end_point . '?' . $query, $api_secret); $client = new Client([ 'headers' => [ 'Content-Type' => 'application/json', 'APIKEY' => $api_key, 'Signature' => $signature ], ]); $response = $client->request('GET', $url . '?' . $query); $data = json_decode($response->getBody()); return $data; } public function getSignals(){ // Initialize the client $api = new Client([ 'base_uri' => 'https://app.signalprofits.com/', 'cookies' => true, // You have to have cookies turned on for this API to work ]); // Login $api->post('app/login', [ 'form_params' => [ 'identity' => 'john@eutrading.co.uk', // use your actual username 'password' => 'l0uis0404!', // use your actual password ], ]); // Fetch $response = $api->get('app/login'); // and decode some data $boxscore = $response->getBody(); // And logout $test = $api->get('wp-admin/admin-ajax.php?action=get_signals&limit=100'); $test2 = $test->getBody(); // $test2 = json_decode($test->getBody()); return $test2; } }