API. define("APIKeyID", "00000"); define("APIKey", "12345abcde12345abcde12345abcdeff"); $params = array( "ABC000", // ezeio serial "from=2021-11-01", // start of data "to=2021-11-10", // end of data "fields=1,12,cRSSI", // list of fields we care about "1h", // 1h interval data.. "mean" // ..as averages ); // Set up cURL $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, APIURI."/".implode("/", $params)); // All API calls use Digest AUTH curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); curl_setopt($ch, CURLOPT_USERPWD, APIKeyID.":".APIKey); // Set a 5s timeout, return any received data, ignore ssl errors curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Execute the cURL request $response = curl_exec($ch); if(curl_errno($ch)) // if there's an error.. die(curl_error($ch)); // quit and show what the problem is curl_close($ch); // Decode the json reply into an associative array $json = json_decode( $response, TRUE ); // Show what we received print_r($json);