Bookingsync

Developer API Documentation

Rentals Private

Show

GET /rentals/#{id}.xml

Returns a single rental identified by its integer ID.

Response

Status: 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<rental>
  <account-id type="integer">1</account-id>
  <id type="integer">1</id>
  <created-at type="datetime">2012-05-18T10:00:00Z</created-at>
  <updated-at type="datetime">2012-05-18T11:00:00Z</updated-at>
  <description>8pers. 160 m2</description>
  <name>Anatoli</name>
  <position type="integer">2</position>
</rental>

List all

GET /rentals.xml

Returns a list of all rentals. A default of maximum 50 rentals is returned per page, ordered by position.

Parameters

  • page. Optional. Specifies the page of rentals to retrieve. (default: 1)
    • Example: https://www.bookingsync.com/rentals.xml?page=2
  • per_page. Optional. Specifies the maximum number of rentals to return per page. (default: 50, maximum: 500)
    • Example: https://www.bookingsync.com/rentals.xml?per_page=500

Response

Status: 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<rentals type="array">
  <rental>
    ...
  </rental>
  <rental>
    ...
  </rental>
  ...
</rentals>

Create

POST /rentals.xml

Creates a new rental. The XML for the new rental is returned on a successful request with the timestamps recorded.

If the account doesn’t allow for more rentals to be created, a “507 Insufficient Storage” response will be returned.

If the account is active (trial period finished), new rentals must be added from the web interface as a payment is required. Otherwise a “402 Payment Required” response will be returned.
Registering your BookingSync account as an External Application will remove such limitation. To do so, please contact info@bookingsync.com

Request

<?xml version="1.0" encoding="UTF-8"?>
<rental>
  <description>6 pers. 220m²</description>
  <name>Villa Sivota</name>
</rental>

Response

Status: 201 Created
Location: https://www.bookingsync.com/rentals/#{new-rental-id}.xml

<?xml version="1.0" encoding="UTF-8"?>
<rental>
  <account-id type="integer">1</account-id>
  <id type="integer">1</id>
  <created-at type="datetime">2012-05-18T22:02:53Z</created-at>
  <updated-at type="datetime">2012-05-18T22:02:53Z</updated-at>
  <description>6 pers. 220m&#178;</description>
  <name>Villa Sivota</name>
  <position type="integer">5</position>
</rental>

Update

PUT /rentals/#{id}.xml

Updates an existing rental with new details from the submitted XML.

Request

<?xml version="1.0" encoding="UTF-8"?>
<rental>
  <description>6 pers. 240m²</description>
</rental>

Response

Status: 200 OK

Destroy

DESTROY /rentals/#{id}.xml

Destroys the rental identified by its integer ID.

Response

Status: 200 OK