<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.fonnte.com/device',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => array(
    'Authorization: ' . $data['api_key'] . ''
  ),
));

$response = curl_exec($curl);

curl_close($curl);
//echo $response;
$data_json = json_decode($response,true);

//echo "<br>Pengirim: ". $data_json['device']; 
//echo "<br>Status: ". $data_json['device_status']; 

?>

<?php
/* result
{
    "device": "62xxxxxxxxxx",
    "device_status": "connect",
    "expired": "18 November 2029",
    "messages": 16785,
    "name": "admin",
    "package": "Reguler",
    "quota": "78",
    "status": true
}
*/