Im using cakephp to make plugin, so i did apiController to return data (updated) from data base.. I m calling the function as :
$token = hash("sha256","appliTest".strtotime(date('Y-m-d')));
$date = strtotime(date('Y-m-d'));
$api_data = file_get_contents("http://local.mywebsite.com/appliTest/
api/getData?token=".$token);
and in that function getData in apiController i did this :
if((isset($this->params["url"]["token"]))
&&($this->params["url"]["token"]==hash("sha256","appliTest".strtotime(date('Y-m-d'))))){
die("ok");
}
thanks for helping ...