Rental URLs

  1. Overview
  2. List Rental URLs
  3. Get a single Rental URL
  4. Create a new Rental URL
  5. Update a Rental URL
  6. Destroy a Rental URL

Overview

This resource represents Rental URLs which are the URLs under where Rentals are available on the channels’ websites.

Parameters

Name Type Read/Write Description
account Integer Read Account’s ID related to the Rental link
rental Integer Read Rental’s ID related to the Rental link
id Integer Read Rental URL’s ID.
label String Read Rental URL’s label - usually represents the channel’s or application’s name.
url String Read The URL where the Rental is available on the channel’s website.
lock Object Read Lock shows what’s editable/not-editable (representing ownership status).
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 Constraints
account Integer Read Account’s ID related to the Rental link  
rental Integer Read Rental’s ID related to the Rental link  
id Integer Read Rental URL’s ID.  
label String Read/Write Rental URL’s label - usually represents the channel’s or application’s name.  
url String Read/Write The URL where the Rental is available on the channel’s website.  
lock Object Read Lock shows what’s editable/not-editable (representing ownership status).  
locked Boolean Write Setting locked to true means that other apps won’t be able to modify this Rental URL (your application will be granted exclusivity for managing this resource).  
created_at Time Read Photo’s create time.  
updated_at Time Read Photo’s update time.  

List Rental URLs

List all Rental URLs 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 Rental URL

Returns a single Rental URL 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 Rental URL

Returns a newly created Rental URL 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 Rental URL

Returns an updated Rental URL 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 Rental URL

Required OAuth scope: :rentals_write

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

DELETE /rental_urls/:rental_url_id