Hi,
hier mal der erste funkltionierende Script zum abrufen der Daten:
PHP-Code:
require_once('conf.tpl');
$ch = curl_init();
$headr = array();
$headr[] = 'Content-type: application/json';
$headr[] = 'Authorization: Bearer '.$token;
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
curl_setopt($ch, CURLOPT_HTTPGET, 1);
$data = curl_exec($ch);
if($data === false):
echo 'Die Seite konnte nicht geladen werden!';
return false;
endif;
curl_close($ch);
$data_array = json_decode($data, true);
sort($data_array);
var_dump($data_array);
Lesezeichen