Photos

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

Overview

This resource represents Photos belonging to Rentals used for presentational purposes.

Parameters

Name Type Read/Write Description
account Integer Read Account’s ID related to the Photo
rental Integer Read Rental’s ID related to the Photo
id Integer Read Photo’s ID.
compact_url String Read Photo’s compact size (384x256) url.
description Object Read Photo’s description, list of locales described in enums section.
giant_url String Read Photo’s giant size (2400x1600) url.
grande_url String Read Photo’s grande size (1536x1024) url.
height Integer Read Photo’s height in pixels.
kind String Read Photo’s kind, list of kinds described in enum section.
large_url String Read Photo’s large size (1200x800) url.
medium_url String Read Photo’s medium size (768x512) url.
micro_url String Read Photo’s micro size (48x32) url.
position Integer Read Photo’s position on the rental list.
ratio Decimal Read Photo’s width to height ratio.
small_url String Read Photo’s small size (192x128) url.
thumb_url String Read Photo’s thumb size (96x64) url.
width Integer Read Photo’s width in pixels.
size_in_bytes Integer Read Photo’s size in bytes
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 Photo  
rental Integer Read Rental’s ID related to the Photo  
id Integer Read Photo’s ID.  
compact_url String Read Photo’s compact size (384x256) url.  
description Object Read/Write Photo’s description, list of locales described in enums section Maximum length: 80
giant_url String Read Photo’s giant size (2400x1600) url.  
grande_url String Read Photo’s grande size (1536x1024) url.  
height Integer Read Photo’s height in pixels.  
kind String Read/Write Photo’s kind, list of kinds described in enum section.  
large_url String Read Photo’s large size (1200x800) url  
medium_url String Read Photo’s medium size (768x512) url.  
micro_url String Read Photo’s micro size (48x32) url.  
photo File Write Photo’s image. photo or remote_photo_url - one of these is required
position Integer Read/Write Photo’s position on the rental list.  
ratio Decimal Read Photo’s width to height ratio.  
remote_photo_url String Write Required. Photo’s remote url photo or remote_photo_url - one of these is required, must be a valid URL
small_url String Read Photo’s small size (192x128) url.  
thumb_url String Read Photo’s thumb size (96x64) url.  
width Integer Read Photo’s width in pixels.  
size_in_bytes Integer Read Photo’s size in bytes  
created_at Time Read Photo’s create time.  
updated_at Time Read Photo’s update time.  

List photos

List all photos for a given account(s).

GET /photos

Response

{
  "links": {
    "photos.account": "https://www.bookingsync.com/api/v3/accounts/{photos.account}",
    "photos.rental": "https://www.bookingsync.com/api/v3/rentals/{photos.rental}"
  },
  "photos": [
    {
      "id": 1,
      "compact_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/compact_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "description": {
        "en": "Wonderful living room",
        "fr": "Superbe salon"
      },
      "giant_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/giant_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "grande_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/grande_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "height": 2000,
      "kind": "livingroom",
      "large_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/large_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "medium_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/medium_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "micro_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/micro_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "position": 1,
      "ratio": "1.5",
      "small_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/small_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "thumb_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/thumb_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "width": 3000,
      "created_at": "2023-12-11T08:26:25Z",
      "updated_at": "2023-12-11T08:26:25Z",
      "links": {
        "account": 1,
        "rental": 3
      }
    }
  ]
}

Get a single photo

Returns a single photo identified by ID.

GET /photos/:photo_id

Response

{
  "links": {
    "photos.account": "https://www.bookingsync.com/api/v3/accounts/{photos.account}",
    "photos.rental": "https://www.bookingsync.com/api/v3/rentals/{photos.rental}"
  },
  "photos": [
    {
      "id": 1,
      "compact_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/compact_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "description": {
        "en": "Wonderful living room",
        "fr": "Superbe salon"
      },
      "giant_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/giant_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "grande_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/grande_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "height": 2000,
      "kind": "livingroom",
      "large_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/large_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "medium_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/medium_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "micro_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/micro_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "position": 1,
      "ratio": "1.5",
      "small_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/small_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "thumb_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/thumb_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "width": 3000,
      "created_at": "2023-12-11T08:26:25Z",
      "updated_at": "2023-12-11T08:26:25Z",
      "links": {
        "account": 1,
        "rental": 3
      }
    }
  ]
}

Create a new photo

Translated attributes

Please note that translated attributes are updated differenly than you read them.
To set the English description, locale en, you need to use the description_en attribute.

List of locales described in enums section.

Returns a newly created photo for given rental.

POST /rentals/:rental_id/photos

Example JSON request

{
  "photos": [
    {
      "description_en": "Wonderful living room",
      "description_fr": "Superbe salon",
      "kind": "livingroom",
      "position": 1,
      "remote_photo_url": "http://www.gstatic.com/webp/gallery/1.jpg"
    }
  ]
}

Response

{
  "links": {
    "photos.account": "https://www.bookingsync.com/api/v3/accounts/{photos.account}",
    "photos.rental": "https://www.bookingsync.com/api/v3/rentals/{photos.rental}"
  },
  "photos": [
    {
      "id": 1,
      "compact_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/compact_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "description": {
        "en": "Wonderful living room",
        "fr": "Superbe salon"
      },
      "giant_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/giant_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "grande_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/grande_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "height": 2000,
      "kind": "livingroom",
      "large_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/large_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "medium_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/medium_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "micro_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/micro_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "position": 1,
      "ratio": "1.5",
      "small_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/small_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "thumb_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/thumb_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "width": 3000,
      "created_at": "2023-12-11T08:26:25Z",
      "updated_at": "2023-12-11T08:26:25Z",
      "links": {
        "account": 1,
        "rental": 3
      }
    }
  ]
}

Update a photo

Translated attributes

Please note that translated attributes are updated differenly than you read them.
To set the English description, locale en, you need to use the description_en attribute.

List of locales described in enums section.

Returns an updated photo identified by ID.

PUT /photos/:photo_id

Example JSON request

{
  "photos": [
    {
      "description_en": "Wonderful living room",
      "description_fr": "Superbe salon",
      "kind": "livingroom",
      "position": 1,
      "remote_photo_url": "http://www.gstatic.com/webp/gallery/2.jpg"
    }
  ]
}

Response

{
  "links": {
    "photos.account": "https://www.bookingsync.com/api/v3/accounts/{photos.account}",
    "photos.rental": "https://www.bookingsync.com/api/v3/rentals/{photos.rental}"
  },
  "photos": [
    {
      "id": 1,
      "compact_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/compact_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "description": {
        "en": "Wonderful living room",
        "fr": "Superbe salon"
      },
      "giant_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/giant_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "grande_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/grande_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "height": 2000,
      "kind": "livingroom",
      "large_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/large_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "medium_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/medium_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "micro_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/micro_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "position": 1,
      "ratio": "1.5",
      "small_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/small_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "thumb_url": "http://bs-eu.s3.amazonaws.com/app/production/photo/photo/1/thumb_1c4a6fb74004bb654fbb7972e4c78625.jpg",
      "width": 3000,
      "created_at": "2023-12-11T08:26:25Z",
      "updated_at": "2023-12-11T08:26:25Z",
      "links": {
        "account": 1,
        "rental": 3
      }
    }
  ]
}

Destroy a photo

Required OAuth scope: :rentals_write

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

DELETE /photos/:photo_id