API documentation

Get suggested Parkings

GET /api/parkings/suggest

Include access_token in HTTP header:

Authorization: Bearer 09ba487fc3df...

Description

This web service returns the first {n} (default = 9, parameter set on the server side) from an area of {m} km (default = 5, parameter set on the server side) around the point sent as param

Parameters

Parameter name Parameter type Description
lat float latitude of the position of the user
lng float longitude of the position of the user

Response

Status Code: 200 if OK

{
    "suggested_parkings": [
        {
            "id": 844,
            "name": "Dorobantilor",
            "free_spaces": 28,
            "occupied_spaces": 27,
            "unknown_spaces": 12,
            "is_favorite": false,
            "default_price": 2.0
            "price_unit": "hour",
            "type": "ParkingLot",
            "zone": {
                "id": 37,
                "price_unit": "hour",
                "price": "1.0"
            },
            "location": {
                "street": "Strada Dorobantilor 13-24",
                "city": "Cluj-Napoca",
                "country": "Romania",
                "point": {
                    "latitude": "46.7689212632758",
                    "longitude": "23.5942527651787"
                }
            },
            "distance_text": "0.1 km"
        },
        {
            "id": 849,
            "name": "B.P.Hasdeu",
            "free_spaces": 21,
            "occupied_spaces": 27,
            "unknown_spaces": 12,
            "is_favorite": false,,
            "default_price": 2.0
            "type": "ParkingLot",
            "location": {
                "street": "Strada B.P.Hasdeu 16-30",
                "city": "Cluj-Napoca",
                "country": "Romania",
                "point": {
                    "latitude": "46.7710633477534",
                    "longitude": "23.5939389467239"
                }
            },
            "distance_text": "0.1 km"
        }
}

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
is_favorite bool true if parking is set as favorite by user
default_price int the default price of the parking
price_unit string time unit for default_price param, (hour/minute)
zone object null if parking of type 'SecuredParking' or object with details of the zone
location object object containing the location of the parking
distance_text object distance from the searched location to the parking

OR (if no parking areas in range)

{
    "suggested_parkings": []
}

Status Code: 401 if request not ok