Browse Source

added fake api script to test api response (test-json.php)

master
user 4 years ago
parent
commit
a495ade686
  1. 12
      website/test-json.php

12
website/test-json.php

@ -0,0 +1,12 @@
<?php
// JSON tester to send out fake tier API responses to test our scripts and not abuse the Tier server
// Usage: http://localhost:8080/test-json.php?scooterID=1
$scooterID = htmlspecialchars($_GET["scooterID"]);
// example data response for one scooter/request
echo '{"data":{"type":"vehicle","id":"'.$scooterID.'-d739d6-554f-4eaf-bd9c-afe3d501c94b","attributes":{"state":"ACTIVE","lastLocationUpdate":"2020-10-09T08:00:29Z","lastStateChange":"2020-10-07T15:09:13Z","batteryLevel":51,"lat":52.504926,"lng":13.358061,"maxSpeed":20,"zoneId":"BERLIN","code":272581,"iotVendor":"okai","licencePlate":"115MZJ","isRentable":true,"vehicleType":"escooter","hasHelmetBox":true,"hasHelmet":true}}}';
?>
Loading…
Cancel
Save