LivingRooms

  1. Overview
  2. List living_rooms
  3. Get a single living_room
  4. Create a new living_room
  5. Update a living_room
  6. Destroy a living_room

Overview

This resource represents the rental’s living rooms. This resource is mostly static information used for presentational purposes.

Parameters

Name Type Read/Write Description
rental Integer Read Rental’s ID related to LivingRoom
account Integer Read Account’s ID related to LivingRoom
id Integer Read LivingRoom’s id.
bunk_beds_count Integer Read LivingRoom’s number of bunk beds.
double_beds_count Integer Read LivingRoom’s number of double beds.
kingsize_beds_count Integer Read LivingRoom’s number of kingsize beds.
queensize_beds_count Integer Read LivingRoom’s number of queensize beds.
single_beds_count Integer Read LivingRoom’s number of single beds.
sofa_beds_count Integer Read LivingRoom’s number of sofa beds.
created_at Time Read LivingRoom’s create time.
updated_at Time Read LivingRoom’s update time.
Name Type Read/Write Description Constraints
rental Integer Read Rental’s ID related to LivingRoom  
account Integer Read Account’s ID related to LivingRoom  
id Integer Read LivingRoom’s id.  
bunk_beds_count Integer Read/Write LivingRoom’s number of bunk beds. integer only, greater than or equal to: 0
double_beds_count Integer Read/Write LivingRoom’s number of double beds. integer only, greater than or equal to: 0
kingsize_beds_count Integer Read/Write LivingRoom’s number of kingsize beds. integer only, greater than or equal to: 0
queensize_beds_count Integer Read/Write LivingRoom’s number of queensize beds. integer only, greater than or equal to: 0
single_beds_count Integer Read/Write LivingRoom’s number of single beds. integer only, greater than or equal to: 0
sofa_beds_count Integer Read/Write LivingRoom’s number of sofa beds. integer only, greater than or equal to: 0
created_at Time Read LivingRoom’s create time.  
updated_at Time Read LivingRoom’s update time.  

List living_rooms

List all living_rooms for a given account.

GET /living_rooms

Response

{
  "links": {
    "living_rooms.rental": "https://www.bookingsync.com/api/v3/rentals/{living_rooms.rental}"
  },
  "living_rooms": [
    {
      "id": 1,
      "bunk_beds_count": 0,
      "double_beds_count": 1,
      "kingsize_beds_count": 0,
      "queensize_beds_count": 0,
      "single_beds_count": 2,
      "sofa_beds_count": 1,
      "created_at": "2023-12-11T08:26:26Z",
      "updated_at": "2023-12-11T08:26:26Z",
      "links": {
        "rental": 1
      }
    }
  ],
  "meta": {
  }
}

Get a single living_room

Returns a single living_room identified by ID.

GET /living_rooms/:living_room_id

Response

{
  "links": {
    "living_rooms.rental": "https://www.bookingsync.com/api/v3/rentals/{living_rooms.rental}"
  },
  "living_rooms": [
    {
      "id": 1,
      "bunk_beds_count": 0,
      "double_beds_count": 1,
      "kingsize_beds_count": 0,
      "queensize_beds_count": 0,
      "single_beds_count": 2,
      "sofa_beds_count": 1,
      "created_at": "2023-12-11T08:26:26Z",
      "updated_at": "2023-12-11T08:26:26Z",
      "links": {
        "rental": 1
      }
    }
  ],
  "meta": {
  }
}

Create a new living_room

Creates a living_room for given rental.

POST /rentals/:rental_id/living_rooms

Example JSON request

{
  "living_rooms": [
    {
      "bunk_beds_count": 0,
      "double_beds_count": 1,
      "kingsize_beds_count": 0,
      "queensize_beds_count": 0,
      "single_beds_count": 2,
      "sofa_beds_count": 1
    }
  ]
}

Response

{
  "links": {
    "living_rooms.rental": "https://www.bookingsync.com/api/v3/rentals/{living_rooms.rental}"
  },
  "living_rooms": [
    {
      "id": 1,
      "bunk_beds_count": 0,
      "double_beds_count": 1,
      "kingsize_beds_count": 0,
      "queensize_beds_count": 0,
      "single_beds_count": 2,
      "sofa_beds_count": 1,
      "created_at": "2023-12-11T08:26:26Z",
      "updated_at": "2023-12-11T08:26:26Z",
      "links": {
        "rental": 1
      }
    }
  ],
  "meta": {
  }
}

Update a living_room

Returns an updated living_room identified by ID.

PUT /living_rooms/:living_room_id

Example JSON request

{
  "living_rooms": [
    {
      "bunk_beds_count": 0,
      "double_beds_count": 1,
      "kingsize_beds_count": 0,
      "queensize_beds_count": 0,
      "single_beds_count": 2,
      "sofa_beds_count": 1
    }
  ]
}

Response

{
  "links": {
    "living_rooms.rental": "https://www.bookingsync.com/api/v3/rentals/{living_rooms.rental}"
  },
  "living_rooms": [
    {
      "id": 1,
      "bunk_beds_count": 0,
      "double_beds_count": 1,
      "kingsize_beds_count": 0,
      "queensize_beds_count": 0,
      "single_beds_count": 2,
      "sofa_beds_count": 1,
      "created_at": "2023-12-11T08:26:26Z",
      "updated_at": "2023-12-11T08:26:26Z",
      "links": {
        "rental": 1
      }
    }
  ],
  "meta": {
  }
}

Destroy a living_room

Required OAuth scope: :rentals_write

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

DELETE /living_rooms/:living_room_id