API documentation

Get current areas and user cars

GET /api/payment/information

Include access_token in HTTP header:

Authorization: Bearer 09ba487fc3df...

Description

This web service return information about the user cars, and also about the zones that can be selected for parking payment.

Parameters

Parameter name Parameter type Description
zone_id int this parameter is used when a area is already selected (not required)
project_id int this parameter is used to filter zones based on project (not required)
latitude float this parameter is used to filter zones based on user location latitude (not required) *
longitude float this parameter is used to filter zones based on user location longitude (not required) *

* in order to filter zones by latitude and longitude both parameters are required

Response

Status Code: 200 if OK

{
    "zones":
    [
    {
        "zone": {
             "scheduler_hours": [
                    {
                        "scheduler_hour": {
                            "price": "4.0",
                            "hour_of_the_week": 0
                        }
                    },
                    {
                        "scheduler_hour": {
                            "price": "4.0",
                            "hour_of_the_week": 1
                        }
                    },
                      ...
                    {
                        "scheduler_hour": {
                            "price": "4.0",
                            "hour_of_the_week": 167
                        }
                    }
                ],
            "id": 46,
            "name": "Zona 1",
            "price": 2,
            "price_unit": "hour",
            "current_time": "2015-04-14 14:15:46",
            "selected": true
        }
    }, {
        "zone": {
            "scheduler_hours": null,
            "id": 47,
            "name": "Zona 2",
            "price": 1,
            "price_unit": "hour",
            "current_time": "2015-04-14 14:15:46",
            "selected": false
        }
    }
  ],
   "cars":
    [
    {
        "car": {
           "id": 8,
           "plate_number": "BN88TIT",
           "is_default": true
        }
    }, {
        "car": {
            "id": 9,
            "plate_number": "BN23TIT",
            "is_default": false
        }
    }
  ]
}
Parameter name Parameter type Description
zones object list of available zones
cars object list of user cars
zone object object containing information about a zone (id, name, price, selected (true if a zone is already selected), scheduler_hours, current_time)
zone/price_unit string time unit for zone/price (hour/minute)
cars object list of user cars
car object object containing information about a car (id , plate_number,is_default)
scheduler_hour object object containing information about hour prices (hour_of_the_week, price)
Note: "scheduler_hours" is the new mode used for calculating the price. It is divided in 168(number of hours in a week) "scheduler_hour" and each "scheduler_hour" has "hour_of_the_week" (the number of the hour in the week) and the "price" for that hour. You can use this for calculating the price. The ws returns only the hours that have a different price than the default price.
Note: "scheduler_hours" can be null, and if so you should use the default "price" from the "zone" object.
Note: Zones which have price 0 are not returned by this action.
Note: The "current_time" is used by the application to correctly calculate the price for a payment even if there is a different time set on phone.

Status Code: 401 if request not ok