Rental URLs

  1. List RentalURLs
  2. Get a single RentalURL
  3. Create a new RentalURL
  4. Update a RentalURL
  5. Destroy a RentalURL

Parameters

Name Type Read/Write Description
id Integer Read RentalURL’s id.
label String Read Usually equals the application’s name.
url String Read The URL where the rental is visible on the channel’s website.
lock Object Read Lock shows what’s not editable.
canceled_at Time Read Time of soft delete.
created_at Time Read Photo’s create time.
updated_at Time Read Photo’s update time.
Name Type Read/Write Description
id Integer Read RentalURL’s id.
label String Read Usually equals the application’s name.
url String Read The URL where the rental is visible on the channel’s website.
lock Object Read Lock shows what’s not editable.
locked Boolean Write Setting locked to true means that other apps won’t be able to modify this resource.
canceled_at Time Read Time of soft delete.
created_at Time Read Photo’s create time.
updated_at Time Read Photo’s update time.

List RentalURLs

List all RentalURLs for a given account(s).

GET /rental_urls

Response

{
  "links": {
    "rental_urls.account": "https://www.bookingsync.com/api/v3/accounts/{rental_urls.account}",
    "rental_urls.rental": "https://www.bookingsync.com/api/v3/rentals/{rental_urls.rental}"
  },
  "rental_urls": [
    {
      "id": "090fc7dd-f677-4a6f-b6df-8035f00b4108",
      "label": "Example OTA",
      "lock": {
        "record": "doorkeeper/application-2",
        "attributes": {
        }
      },
      "url": "https://ota.example.com/rentals/333",
      "created_at": "2020-02-06T03:49:53Z",
      "updated_at": "2020-02-06T03:49:53Z",
      "canceled_at": null,
      "links": {
        "account": 1,
        "rental": 2
      }
    }
  ],
  "meta": {
    "Link": {
      "first": "https://www.bookingsync.com/api/v3/rental_urls?page=1",
      "last": "https://www.bookingsync.com/api/v3/rental_urls?page=1"
    },
    "X-Per-Page": "100",
    "X-Total-Count": "1",
    "X-Total-Pages": "1"
  }
}

Get a single RentalURL

Returns a single RentalURL identified by ID.

GET /rental_urls/:rental_url_id

Response

{
  "links": {
    "rental_urls.account": "https://www.bookingsync.com/api/v3/accounts/{rental_urls.account}",
    "rental_urls.rental": "https://www.bookingsync.com/api/v3/rentals/{rental_urls.rental}"
  },
  "rental_urls": [
    {
      "id": "090fc7dd-f677-4a6f-b6df-8035f00b4108",
      "label": "Example OTA",
      "lock": {
        "record": "doorkeeper/application-2",
        "attributes": {
        }
      },
      "url": "https://ota.example.com/rentals/333",
      "created_at": "2020-02-06T03:49:53Z",
      "updated_at": "2020-02-06T03:49:53Z",
      "canceled_at": null,
      "links": {
        "account": 1,
        "rental": 2
      }
    }
  ],
  "meta": {
    "Link": {
      "first": "https://www.bookingsync.com/api/v3/rental_urls?page=1",
      "last": "https://www.bookingsync.com/api/v3/rental_urls?page=1"
    },
    "X-Per-Page": "100",
    "X-Total-Count": "1",
    "X-Total-Pages": "1"
  }
}

Create a new RentalURL

Returns a newly created RentalURL for given rental.

POST /rentals/:rental_id/rental_urls

Example JSON request

{
  "rental_urls": [
    {
      "label": "Example OTA",
      "locked": true,
      "url": "https://ota.example.com/rentals/333"
    }
  ]
}

Response

{
  "links": {
    "rental_urls.account": "https://www.bookingsync.com/api/v3/accounts/{rental_urls.account}",
    "rental_urls.rental": "https://www.bookingsync.com/api/v3/rentals/{rental_urls.rental}"
  },
  "rental_urls": [
    {
      "id": "090fc7dd-f677-4a6f-b6df-8035f00b4108",
      "label": "Example OTA",
      "lock": {
        "record": "doorkeeper/application-2",
        "attributes": {
        }
      },
      "url": "https://ota.example.com/rentals/333",
      "created_at": "2020-02-06T03:49:53Z",
      "updated_at": "2020-02-06T03:49:53Z",
      "canceled_at": null,
      "links": {
        "account": 1,
        "rental": 2
      }
    }
  ],
  "meta": {
    "Link": {
      "first": "https://www.bookingsync.com/api/v3/rental_urls?page=1",
      "last": "https://www.bookingsync.com/api/v3/rental_urls?page=1"
    },
    "X-Per-Page": "100",
    "X-Total-Count": "1",
    "X-Total-Pages": "1"
  }
}

Update a RentalURL

Returns an updated RentalURL identified by ID.

PUT /rental_urls/:rental_url_id

Example JSON request

{
  "rental_urls": [
    {
      "url": "https://ota.example.com/rentals/333"
    }
  ]
}

Response

{
  "links": {
    "rental_urls.account": "https://www.bookingsync.com/api/v3/accounts/{rental_urls.account}",
    "rental_urls.rental": "https://www.bookingsync.com/api/v3/rentals/{rental_urls.rental}"
  },
  "rental_urls": [
    {
      "id": "090fc7dd-f677-4a6f-b6df-8035f00b4108",
      "label": "Example OTA",
      "lock": {
        "record": "doorkeeper/application-2",
        "attributes": {
        }
      },
      "url": "https://ota.example.com/rentals/333",
      "created_at": "2020-02-06T03:49:53Z",
      "updated_at": "2020-02-06T03:49:53Z",
      "canceled_at": null,
      "links": {
        "account": 1,
        "rental": 2
      }
    }
  ],
  "meta": {
    "Link": {
      "first": "https://www.bookingsync.com/api/v3/rental_urls?page=1",
      "last": "https://www.bookingsync.com/api/v3/rental_urls?page=1"
    },
    "X-Per-Page": "100",
    "X-Total-Count": "1",
    "X-Total-Pages": "1"
  }
}

Destroy a RentalURL

Required OAuth scope: :rentals_write

Returns an empty response with ‘204 No Content’ status code on success.

DELETE /rental_urls/:rental_url_id