 <?php
 
require 'KooKoo-PHP/kookoophp/response.php';//include response.php into your code
$r = new response();


$json_url ='https://sampark-staging.mahiti.org/api/content/';
$ch = curl_init( $json_url );
$options = array(
CURLOPT_RETURNTRANSFER => true,
//CURLOPT_USERPWD => $username . “:” . $password,  // authentication
//CURLOPT_HTTPHEADER => array(‘Content-type: application/json’) ,
//CURLOPT_POSTFIELDS => $json_string
);
curl_setopt_array( $ch, $options );
$result = curl_exec($ch); 
//print($ch);

$decode_data = json_decode($result);
    foreach($decode_data as $key=>$value){

       $r->addPlayText("Playing ".$value->title."");    

    }


// Play any text to play
$r->addHangup();
$r->send();

  ?>
