This repository was archived by the owner on Jul 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Data
Moritz Walter edited this page Feb 2, 2020
·
1 revision
Du kannst Daten im User speichern, die nur du dann wieder abfragen kannst.
Daten abfragen: Typen:
getdata => Gibt Daten mit einen bestimmten Key aus
getdataordernewtest => Gibt Daten mit einen bestimmten Key nach neusten geordnet aus
getalldata => Gibt alle Daten aus
$info_request = "https://oauth.the-systems.eu/api/data/index.php?type=getdata";
$info = curl_init();
curl_setopt_array($info, array(
CURLOPT_URL => $info_request,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "access_token=".$resp->access_token,
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: application/x-www-form-urlencoded",
"key: speedtest-result"
),
));
curl_setopt($info, CURLOPT_RETURNTRANSFER, true);
$inforesp = json_decode(curl_exec($info));
curl_close($info);
Key wird im Header angegeben.
$info_request = "https://oauth.the-systems.eu/api/data/index.php?type=savedata";
$info = curl_init();
curl_setopt_array($info, array(
CURLOPT_URL => $info_request,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "access_token=".$resp->access_token,
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: application/x-www-form-urlencoded",
"key: key",
"value: value"
),
));
curl_setopt($info, CURLOPT_RETURNTRANSFER, true);
$inforesp = json_decode(curl_exec($info));
curl_close($info);