3 Parking endpoints
Tim Svensson edited this page 2026-05-11 11:20:55 +00:00

Parking endpoints

GET /parking/latest

Path to endpoint

GET /parking/latest

Required values

None

Return values

Returns a JSON array:

  • zoneCode: the zone the spot is in
  • spotId: the spot's ID
  • isOccupied: if occupied or not
  • timestamp: time of reading
  • charging: if spot is a charging spot
  • disabled: if spot is a disabled spot
  • reserved: if spot is a reserved spot

When no error occurs

  • Returns all spots and their data
  • Status: 200 OK

When error occurs

  • Server failure or database issue
  • Status: 404

GET /parking/latest/zone/{zoneCode}

Path to endpoint

GET /parking/latest/zone/{zoneCode}

Required values

  • zoneCode: A zone name

Return values

Returns a JSON array:

  • zoneCode: the zone the spot is in
  • spotId: the spot's ID
  • isOccupied: if occupied or not
  • timestamp: time of reading
  • charging: if spot is a charging spot
  • disabled: if spot is a disabled spot
  • reserved: if spot is a reserved spot

When no error occurs

  • Returns all spots in that zone and their data
  • Status: 200 OK

When error occurs

  • Server failure or database issue or zone does not exist
  • Status: 404

GET /parking/latest/spot/{spotId}

Path to endpoint

GET /parking/latest/spot/{spotId}

Required values

  • spotId: A spot ID

Return values

Returns a JSON entry:

  • zoneCode: the zone the spot is in
  • spotId: the spot's ID
  • isOccupied: if occupied or not
  • timestamp: time of reading
  • charging: if spot is a charging spot
  • disabled: if spot is a disabled spot
  • reserved: if spot is a reserved spot

When no error occurs

  • Returns a spot and its data
  • Status: 200 OK

When error occurs

  • Server failure or database issue or spot does not exist
  • Status: 404

GET /parking/zones

Path to endpoint

GET /parking/zones

Required values

None

Return values

Returns a JSON array of strings, example:

["A",
"E",
"F",
"G",
"Grus",
"H"]

When no error occurs

  • Returns all zone names
  • Status: 200 OK

When error occurs

  • Server failure or database issue
  • Status: 404

GET /parking/latest/spotwithattribute/{spotAttribute}

Path to endpoint

GET /parking/latest/spotwithattribute/{spotAttribute}

Required values

  • spotAttribute: The name of a special attribute (charging, disabled, reserved)

Return values

Returns a JSON array:

  • zoneCode: the zone the spot is in
  • spotId: the spot's ID
  • isOccupied: if occupied or not
  • timestamp: time of reading
  • charging: if spot is a charging spot
  • disabled: if spot is a disabled spot
  • reserved: if spot is a reserved spot

When no error occurs

  • Returns all spots that have that special attribute
  • Status: 200 OK

When error occurs

  • Server failure or database issue or attribute does not exist
  • Status: 404