<?php include '../src/osvobdoch_vars.php'; include '../src/osvobdoch_local_vars.php'; $metoda = "GET"; //$cesta = "/api/dochazka/v2/nastaveni"; $cesta = "/api/dochazka/v2/zaci"; # cas "2016-09-30 11:54:12.637"; date_default_timezone_set('Europe/Prague'); $cas= date("Y-m-d H:i:s"); $data = $metoda ."+".$cesta . "+" . $cas . "+" . $apiheslo; $hash = hash_hmac("sha1", $data, $key, $raw_output=false); $auth = $apiuser . ":" . $hash; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url.$cesta); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $metoda); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "com.edookit.Time: ".$cas, "com.edookit.Auth: ".$auth, "com.edookit.Client: ".$id )); $result = curl_exec($ch); echo $result; ?>