API documentation

Get all bookings

GET /api/car_driver/bookings/paid

Include access_token in HTTP header:

Authorization: Bearer 09ba487fc3df...

Description

This web service returns all the paid bookings

REQUEST PARAMETERS

Parameter name Parameter type Description
local_time datetime datetime used to get the type of the booking(past/actual/future)
type string filter by type past/actual/future (optional, defaults to all)
page int get a different page (optional, defaults to 1)
{
  "local_time": "2015-11-23T10:40:00Z",
  "type": "actual",
  "page": 1
}

Response

Status Code: 201 if OK

{
  "current_page": 1,
  "total_entries": 1,
  "total_pages": 1,
  "bookings": [
    {
      "booking": {
        "id": 59,
        "name": "Parking name"
        "start_time": "2015-11-23 10:51:03",
        "end_time": "2015-11-24 10:51:03",
        "duration_minutes": 1440.00000003179,
        "price": 48,
        "type": "actual"
      }
    }
  ]
}

Response parameters

Parameter name Parameter type Description
current_page int current page(used for pagination)
total_entries int number of bookings
total_pages int total number of pages(used for pagination)
bookings list of objects list of bookings objects
booking object object containing the info about a booking
id int id of the booking
name string name of the parking place
start_time datetime start time of the booking
end_time datetime end time of the booking
duration_minutes double duration in minutes of the booking
price int price of the booking
type string can be one of the three values(past/actual/future)

OR (if no bookings)

{
  "current_page": 1,
  "total_entries": 0,
  "total_pages": 1,
  "bookings": []
}

Status Code: 401 if request access token not ok