API documentation

Get all available parkings

POST /api/car_driver/bookings/available_parkings

Include access_token in HTTP header:

Authorization: Bearer 09ba487fc3df...

Description

This web service is used to search for all available secured parkings in an area defined by the topleft corner and bottom right corner

REQUEST PARAMETERS

Parameter name Parameter type Description
start_time datetime start_time used for search
end_time datetime end-time used for search
{
  "start_time" : "2015-04-28 15:00:00",
  "end_time" : "2015-04-28 17:00:00"
}

Response

Status Code: 201 if OK

{
  "parkings_in_range": [
      {
          "id": 73,
          "name": "bla",
          "free_spaces": 0,
          "occupied_spaces": 0,
          "unknown_spaces": 0,
          "type": "SecuredParking",
          "all_spaces": 0,
          "default_price": "12.0",
          "price_unit": "hour",
          "zone": null,
          "location": {
              "street": "dsdss",
              "city": "Cluj-Napoca",
              "country": "Romania",
              "point": {
                  "latitude": "46.766948118665056",
                  "longitude": "23.580665588815464"
              }
          },
          "price_per_hour": "12.0",
          "nr_of_free_spaces": 3
      },
      {
          "id": 72,
          "name": "Bla's Park",
          "free_spaces": 0,
          "occupied_spaces": 0,
          "unknown_spaces": 0,
          "type": "SecuredParking",
          "all_spaces": 0,
          "default_price": "1.0",
          "price_unit": "hour",
          "zone": null,
          "location": {
              "street": null,
              "city": "Cluj-Napoca",
              "country": "Romania",
              "point": {
                  "latitude": "46.76803574549116",
                  "longitude": "23.586695194680942"
              }
          },
          "price_per_hour": "1.0",
          "nr_of_free_spaces": 10
      },

  
            ]
}

Response parameters

Parameter name Parameter type Description
id int id of the parking
name string name of the parking
type string type of the parking
free_spaces int number of free_spaces in the area
occupied_spaces int number of occupied_spaces in the area
unknown_spaces int number of unknown_spaces in the area
default_price string string representation of decimal value
price_unit string time unit for default_price param, (hour/minute)
price_per_hour string string representation of decimal value
location object object containing the location of the parking
nr_of_free_spaces int number of free spaces remaining after dropping the nb. of confirmed bookings in interval (start_time..end_time)

If the number of "unknown_spaces" = "occupied_spaces"+"free_spaces" then the icon for the area should be gray.

OR (if no parking areas in range)

{
    "parkings_in_range": []
}

Status Code: 401 if request access token not ok