Login | Register

Function Search

The Search function will retrieve a range of bookings that meet the filter criteria.  The search may be filtered by:

  • Date Range
  • Booking Status
  • External Reference (Your Reference)
     

This function is limited to return a maximum of 10 items per request.  This is manipulated by the tag <page>.  Page 1 will return results 1-10 and page 2 will return results 11-20 etc.  If fewer than 10 are returned on any page, then there are no more matching results.  A call with no results will have a value of 0 (Zero) in the  count.


<?xml version='1.0' encoding='utf-8'?>
<JobFile>
  <appID>23423413</appID>
  <appSecret>abe1f4dc775a5a055afcd2abfe137b67f615f0bf</appSecret>
  <getQuote>
    <filter>
      <page>1</page>
      <status>all</status>
      <extRef></extRef>
      <dateStart>01-12-2015</dateStart>
      <dateEnd>03-12-2015</dateEnd>
    </filter>
    <requests>
      <request>Quote ID</request>
      <request>REF ID</request>
      <request>Name</request>
      <request>TEL</request>
      <request>EMAIL</request>
      <request>DATE OUT</request>
      <request>ROUTE</request>
      <request>CALLBACK</request>
      <request>PROGRESS</request>
      <request>STATUS</request>
      <request>STAFF</request>
      <request>VEHICLE</request>
      <request>PRICE</request>
      <request>DATE BACK</request>
      <request>PAY</request>
      <request>DRIVER</request>
    </requests>
  </getQuote>
</JobFile>

See the table below for an explanation of the input requirements;

Tag Format Notes
<page> integer As each request is limited to a maximum of 10 results, this determines which block of 10 you are requesting
<status> string a status of all will include bookings that otherwise match the search filter.  Other valid values include B for  active Booking and C for Completed Booking.
<extref> string This is an field you can supply when inserting a booking - which can also be used to search.  This does not have to be unique and many bookings can have the same value.
<dateStart> date Must be in this format of DD-MM-YYYY
<dateEnd> date Must be in this format of DD-MM-YYYY

Data Returned: Search

An example of what is returned from the API is shown below. The code of 200 indicates the call was successful.  The count (in this example 2) indicates  the number of bookings that match the search filter; quote_id is the unique Coach Hire booking reference, date1 refers to the date out while date2 refers to the date back. As their are no values in car_name and drivername this means that they have not yet been assigned for these bookings.

Callback : {
  "code":200,
  "count":2,
  "data":[
    {
      "quote_id":"292398",
      "name":"CustomerName1",
      "phone_h":"038410778",
      "phone_m":"0801020305",
      "email":"customer@theirdomain.com",
      "date1":"2016-03-03 05:00:00",
      "route":"Alderbury,
       Salisbury,
       Wil<br> >>LEEDS HILTON,
       NEVILLE S",
      "callback_date":"Not set",
      "progress":"",
      "status_re":"Booking",
      "sales_person":"",
      "car_name":"",
      "price":"50.54",
      "date2":"2016-03-04 04:00:00",
      "pay_ok":" On Account",
      "drivername":"No driver"
    },
    {
      "quote_id":"292399",
      "name":"CustomerName2",
      "phone_h":"038410778",
      "phone_m":"0801020305",
      "email":"customer@theirdomain.com",
      "date1":"2016-03-03 05:00:00",
      "route":"Alderbury,
       Salisbury,
       Wil<br> >>LEEDS HILTON,
       NEVILLE S",
      "callback_date":"Not set",
      "progress":"",
      "status_re":"Booking",
      "sales_person":"",
      "car_name":"",
      "price":"120.00",
      "date2":"2016-03-04 04:00:00",
      "pay_ok":" On Account",
      "drivername":"No driver"
    }
  ]
}