Link for API: Click Here
I want to get datetime and type parameters i try to but i get:
Notice: Trying to get property of non-object
Here is my try t
$api_key = "apikey here";
$server = "http://api.uptimerobot.com/getMonitors?apiKey=$api_key&logs=1&alertContacts=1&responseTimes=1&responseTimesAverage=180&format=json";
$server2 = file_get_contents($server);
$obj = @json_decode($server2);
$cc = $alert->datetime;
echo $cc;
its not working maybe because its an arrayed json.
Can someone give me whole (right) code to get it work ?
I need only type and datetime parameters in while cycle (prefer)