API documentation

Get parking spaces details

GET /api/parkings/{parking_id}/parking_spaces?level_id={level_id(not_required)}

Include access_token in HTTP header:

Authorization: Bearer 09ba487fc3df...

Description

This web service returns all the parking spaces from inside a parking (cluster of parking spaces), selected by using {parking_id} parameter. Additional information about the selected parking is retrieved. The {level_id} parameter is not required. If this parameter is not set, the web service will return the parking spaces from the default level of the selected parking.

REQUEST PARAMETERS

Parameter name Parameter type Description
parking_id int id of the selected parking
level_id int id of the level on the selected parking (not required)

Response

Status Code: 200 if OK

{
  "location": {
    "street": "B-dul 1 Decembrie",
    "city": "Cluj-Napoca",
    "country": "Romania",
    "point": {
      "latitude": "46.770321160032395",
      "longitude": "23.577776290476322"
    }
  },
  "id": 2161,
  "name": "1 DecembrieSP",
  "type": "SecuredParking",
  "default_price": "2.1",
  "is_favorite": false,
  "features": {
    "booking_24h": false,
    "booking_barrier": true,
    "booking_camera": false,
    "booking_card": true,
    "booking_disabillity": false,
    "booking_garage": false
  },
  "latitude": 46.7703211600324,
  "longitude": 23.5777762904763,
  "price_unit": "hour",
  "currency": "RON",
  "zoomLevel": 19,
  "use_polygon": true,
  "zone": {
    "id": 1,
    "price": "1.0",
    "price_unit": "hour",
    "currency": "RON"
  },
  "level": {
    "level_id": 3,
    "free_spaces": 24,
    "occupied_spaces": 28,
    "name": "Floor",
    "bounds": {
      "top_right_point": null,
      "bottom_left_point": null,
      "center_point": {
        "latitude": 46.7663344816777,
        "longitude": 23.5891190171242
      }
    },
    "image": {
      "url": "http://{app_root}/uploads/level_image/image/6/1small.png",
      "top_right_point": {
        "latitude": 46.773355602486404,
        "longitude": 23.624165804110184
      },
      "bottom_left_point": {
        "latitude": 46.772599511503756,
        "longitude": 23.622506110944215
      },
      "center_point": {
        "latitude": 46.77297755699508,
        "longitude": 23.6233359575272
      }
    },
    "default_level": {
      "level_id": 3,
      "free_spaces": 24,
      "occupied_spaces": 28
    },
    "next_level": {
      "level_id": null,
      "free_spaces": 0,
      "occupied_spaces": 0
    },
    "previous_level": {
      "level_id": 1,
      "free_spaces": 11,
      "occupied_spaces": 5
    }
  },
  "parking_spaces": [
    {
      "parking_space": {
        "latitude": 46.771353,
        "longitude": 23.58623,
        "occupied": false,
        "sensor_id": 28294,
        "sensor_state": "installed"
      }
    }, {
      "parking_space": {
        "latitude": 46.771364,
        "longitude": 23.586272,
        "occupied": false,
        "sensor_id": 28294,
        "sensor_state": "installed"
      }
    }, {
      "parking_space": {
        "latitude": 46.771364,
        "longitude": 23.586272,
        "occupied": false,
        "sensor_id": 28294,
        "sensor_state": "installed"
      }
    }
  ],
  "polygon": [
    {
      "number": 0,
      "latitude": "46.7704038299629",
      "longitude": "23.5775506496429"
    },
    {
      "number": 1,
      "latitude": "46.77046812871",
      "longitude": "23.5777947306633"
    },
    {
      "number": 2,
      "latitude": "46.7703156486992",
      "longitude": "23.577920794487"
    },
    {
      "number": 3,
      "latitude": "46.7702219559483",
      "longitude": "23.5776364803314"
    }
  ]
}

Response PARAMETERS

Parameter name Parameter type Description
location object object containing the location of the parking
id int id of the parking
name string name of the parking
type string type of the parking
default_price null/string null if parking of type 'ParkingLot' or string representation of decimal value if type is 'SecuredParking'
is_favorite bool true if parking is set as favorite by user
features null/object null if parking of type 'ParkingLot' or object with boolean values for parking features
latitude float latitude coordinate of the center of the parking
longitude float longitude coordinate of the center of the parking
price_unit string time unit for default_price, will be included only for parkings of type 'SecuredParking' (hour/minute)
currency string currency used for the payments
zoomLevel int zoom level required for the map
use_polygon bool if true, use polygon points instead of parking_spaces
zone null/object null if parking of type 'SecuredParking' or object with details of the zone
zone/price_unit string time unit for zone/price (hour/minute)
level object object containing information about the current level (see above example)
bounds object object containing info about the bounds(corners) that should be set on the screen when opening this level
bounds/top_right_point object object containing info about the top right corner that should be set. if null use only bounds/center_point
bounds/bottom_left_point object object containing info about the bottom left corner that should be set. if null use only bounds/center_point
bounds/center_point object object containing info about the center point of the parking, the bounds should be use the ones default around this point
level-image object object containing information (placement coordinates, url) about the level image if it exists
default/next/previous-level object object containing info (id, free/occupied spaces) about the default/next/previous level
parking_spaces list list of parking spaces objects
parking_space object object containing info about a parking space (latitude, longitude, occupied)
polygon list list of point object used to draw parking polygon

The latitude and longitude present in the json root are the latitude and longitude of the area.

Status Code: 404 if area id does not exist

Status Code: 401 if request not ok