Added by admin, last edited by admin on Jan 12, 2012  (view change)

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

BookingBug REST API: search companies

Purpose

Used for searching companies within BookingBug. The company represents an abstract group of bookable services. In fact a company can have multiple companies underneath it that are either local offices, or specific departments at a larger location. Only a single company can be managed at a time within BookingBug. The user must switch between companies if they manage large or complex sets of businesses or locations.

URL

[http://[site].bookingbug.com/api/search.format]

Formats

json, xml

Authentication

Requires business API access

Parameters
param type description required?
company_ids
string Companies BookingBug ids separated by space.
e.g. "123 124 125, 451, 452"
No
location
location
Restrict search to a specific location. You can either send a lat/long, a string address or postcode. (Note: See the location details below)
No
date date a date, or range of dates. It can be a start_date or date range. Date range checks for availability for a category across a range of dates, rather than a single date. (Note: See the date details below) No
category string Show only those companies where the company services category matches with this category.
Location
param type description required? Default
latlong
string Latitude and Longitude values separated by space. e.g. "34.53785000 -91.92159000"
No
-
address
string
A string containing address
No -
postcode string
Postcode value No
-
range integer
The diameter to search for companies (in miles) from the provided latlong/address/postcode
No
50
Date
param type description required?
start_date
string It checks for availability for a category starting from this date.
No
end_date
string
Only required when searching required on range of dates. Date range checks for availability for a category across a range of dates, rather than a start_date. No
Examples
curl -basic --url http://[site].bookingbug.com/api/search.xml -uusername:password -H 'Content-type: text/xml' -X GET -d
 "<?xml version="1.0" encoding="utf-8" ?>
    <search>
      <company_ids>1 2 3 4 5</company_ids>
      <location>
        <latlong>34.53785000 -91.92159000</latlong>
        <address></address>
        <postcode></postcode>
        <range>50</range>
      </location>
      <date>
        <start_date>01/01/2007</start_date>
        <end_date>12/30/2009</end_date>
      </date>
      <category>Private Lessons</category>
    </search>"

curl -basic --url http://[site].bookingbug.com/api/search.json -uusername:password -H 'Content-type: application/json' -X GET -d {"search":{company_ids:"1 2 3 4 5","location":{"latlong":"34.53785000 -91.92159000"},"date":{"start_date":"01/01/2007","end_date":"12/30/2009"},"category":"Private Lessons"}}