Skip to content

API Endpoint city server

Basti Tee edited this page Sep 19, 2017 · 7 revisions

Endpoint: https://labs.basti.site/?beaconid=8644d8ef-b649-4a86-b40f-382f89d0bcd0 (full JSON)

Endpoint C-friendly: https://labs.basti.site/?beaconid=8644d8ef-b649-4a86-b40f-382f89d0bcd0&raw=1 (returns only state as integer)

Current demo data: https://github.com/Rebstorm/dthack17/blob/master/smartampel/city-backend/xlight/demodata.csv

States:

  • 0 = Traffic light off
  • 1 = Traffic light green
  • 2 = Traffic light red
  • 3 = Traffic light yellow
  • 4 = Traffic light warnblink
[{
    "model": "xlight.trafficlight",
    "fields": {
        "location_postcode": "53111",
        "current_status": 1,
        "beacon_light_distance": "3",
        "location_streetno": "10",
        "location_city": "Bonn",
        "beaconid": "4d369ebe-9d3e-11e7-89b6-c73a344e7e7c",
        "location_street": "Friedrichstra\u00dfe"
    },
    "pk": null
}, {
    "model": "xlight.apistatus",
    "fields": {
        "http_code": 200,
        "error_message": ""
    },
    "pk": null
}]

Clone this wiki locally