Added by admin, last edited by admin on Mar 26, 2010  (view change)

Labels:

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

BookingBug REST API: person

Purpose

Used for creating and editing people with BookingBug. People represent exactly that, humans who;s time can be booked. A business can have none, one, or multiple people. People can have their own calenders and you can manage which services they offer and other details

URL

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

Formats

json, xml

Authentication

Requies business API access

Parameters
param type description required? default  
name string(50) A persons name Yes    
description string(255) A longer description of the person if required No    
email string(60)
An email address where any booking requests for this person will be sent. Booking requests will be sent to the company default email address, so this is optional No    
mobile string(30) a mobile phone number for the address, of one other following formats: 
+[code] [number]   e.g. +44 12345678    (the space is important) 
+[number] e.g. 012345678 (the default code will be added)
No    
disabled bool
Lets you disabled this person if they for example left the company, such that they can no longer be booked. However if historical booking exist against this person they cannot be fully deleted for data reference purposes No false  
never_booked bool Allows you to say that this person is never marked as booked. If BookingBug is being used as an ancillary enquiry platform, or that the person is not an exact representation of a real person, you can allow the person to be shown as always always available. This should be used with extreame caution as it does then not represent real availability to the user. No false  
position integer An optional value that is used to sort multiple staff in a booking widget in a specific order No -  
ical_link
string A link to an ical calender feed that can overlay a persons time. This allows you to read form an existing external calender source such as Google Calender and overlay that over their availability. This will mean that is their calender is marked as busy in the external calender, then that time will be blocked in BookingBug No 0  
public_ical string A URL for a publicly readable ical feed for this person. Shows just free/busy times when existing bookings are made (read only) No -  
private_ical string A URL for a 'private' ical feed. This shows full booking information for the person, and should be used by the person to overlay into any existing calendar apps they us. This calendar should not be made publically available (read only) No -  
Examples

Get List

XML

curl -basic --url http://[site].bookingbug.com/api/person.xml -uusername:password -H 'Content-type: text/xml' -X GET
curl -basic --url http://[site].bookingbug.com/api/person.xml -uusername:password -H 'Content-type: text/xml' -X GET -d
"<?xml version='1.0' encoding='UTF-8'?>
<person>
  <company_id>id_of_sub_company</company_id>
</person>" (for multiple sub-companies)

JSON

curl -basic --url http://[site].bookingbug.com/api/person.json -uusername:password -H 'Content-type: application/json' -X GET
curl -basic --url http://[site].bookingbug.com/api/person.json -uusername:password -H 'Content-type: application/json' -X GET
-d {"person":{"company_id":id_of_sub_company}}

(for multiple sub-companies)

Get person

XML

curl -basic --url http://[site].bookingbug.com/api/person/[id_of_person].xml -uusername:password -H 'Content-type: text/xml' -X GET
curl -basic --url http://[site].bookingbug.com/api/person/[id_of_person].xml -uusername:password -H 'Content-type: text/xml'
-X GET -d "
<?xml version='1.0' encoding='UTF-8'?>
<person>
  <company_id>id_of_sub_company</company_id>
</person>" (for multiple sub-companies)

JSON

curl -basic --url http://[site].bookingbug.com/api/person/[id_of_person].json -uusername:password -H 'Content-type: application/json' -X GET
curl -basic --url http://[site].bookingbug.com/api/person/[id_of_person].json -uusername:password
-H 'Content-type: application/json' -X GET -d {"person":{"company_id":id_of_company}}

(for multiple sub-companies)

Create person

XML

curl -basic --url http://[site].bookingbug.com/api/person.xml -uusername:password -H 'Content-type:text/xml' -X POST
 -d
"<?xml version='1.0' encoding='UTF-8'?>
<person>
  <name>Person name</name>
  <description>Brief description of a person</description>
  <email>abc@xyz.com</email>
  <mobile>+44 1234567</mobile>
</person>"
curl -basic --url http://[site].bookingbug.com/api/person.xml -uusername:password -H 'Content-type:text/xml' -X POST
 -d
"<?xml version='1.0' encoding='UTF-8'?>
<person>
  <company_id>id of sub company</company_id>
  <name>Person name</name>
  <description>Brief description of a person</description>
  <email>abc@xyz.com</email>
  <mobile>+44 1234567</mobile>
</person>"

(for multiple sub-companies)

JSON

curl -basic --url http://[site].bookingbug.com/api/person.json -uusername:password -H Content-type:application/json -X POST
-d
{"person":{
  "name":"New api Test Person",
  "description":"New api description for the person",
  "email":"new_api_person@bbug.com",
  "mobile":"+44 1234567"
 }
}
curl -basic --url http://[site].bookingbug.com/api/person.json -uusername:password -H Content-type:application/json -X POST
-d
{"person":{
  "company_id":id_of_sub_company,
  "name":"New api Test Person",
  "description":"New api description for the person",
  "email":"new_api_person@bbug.com",
  "mobile":"+44 1234567"
 }
}

(for multiple sub-companies)

Update person

XML

curl -basic --url http://[site].bookingbug.com/api/person/[id_of_person].xml -uusername:password -H 'Content-type:text/xml'
-X PUT -d
"<?xml version='1.0' encoding='UTF-8'?>
<person>
  <name>Person name</name>
  <description>Brief description of a person</description>
  <email>abc@xyz.com</email>
  <mobile>+44 1234567</mobile>
</person>" 

 
curl -basic --url http://[site].bookingbug.com/api/person/[id_of_person].xml -uusername:password -H 'Content-type:text/xml'
-X PUT -d
"<?xml version='1.0' encoding='UTF-8'?>
<person>
  <company_id>id of sub company</company_id>
  <name>Person name</name>
  <description>Brief description of a person</description>
  <email>abc@xyz.com</email>
  <mobile>+44 1234567</mobile>
</person>" 

 

JSON

curl -basic --url http://[site].bookingbug.com/api/person/[id_of_person].json -uusername:password
-H Content-type:application/json -X PUT -d
{"person":{
  "name":"Person name",
  "description":"description for the person",
  "email":"person@bbug.com"
 }
}
curl -basic --url http://[site].bookingbug.com/api/person/[id_of_person].json -uusername:password
-H Content-type:application/json -X PUT -d
{"person":{
  "company_id":id_of_sub_company,
  "name":"Test Person",
  "description":"description for the person",
  "email":"person@bbug.com"
 }
}


Delete person

XML

curl -basic --url http://[site].bookingbug.com/api/person/[id_of_person].xml -uusername:password -H Content-type:text/xml -X DELETE
curl -basic --url http://[site].bookingbug.com/api/person/[id_of_person].xml -uusername:password -H Content-type:text/xml
-X DELETE -d
"<?xml version='1.0' encoding='UTF-8'?>
<person>
  <company_id>id of sub company</company_id>
</person>" 

 

JSON

curl -basic --url http://[site].bookingbug.com/api/person/[id_of_person].json -uusername:password
-H Content-type:application/json -X DELETE


curl -basic --url http://[site].bookingbug.com/api/person/[id_of_person].json -uusername:password
-H Content-type:application/json -X DELETE -d {"person":{"company_id":id_of_sub_company}}