Photos

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

Parameters

Name Type Read/Write Description
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.
created_at Time Read Photo’s create time.
updated_at Time Read Photo’s update time.
Name Type Read/Write Description
id Integer Read Photo’s id.
compact_url String Read Photo’s compact size url.
description Object Read/Write Photo’s description, list of locales described in enums section. (80 characters max)
giant_url String Read Photo’s giant size url.
grande_url String Read Photo’s grande size 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 url.
medium_url String Read Photo’s medium size url.
micro_url String Read Photo’s micro size url.
photo File Write Required. Photo’s image. (remote_photo_url can be used instead)
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 can be used instead)
small_url String Read Photo’s small size url.
thumb_url String Read Photo’s thumb size url.
width Integer Read Photo’s width in pixels.
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": "2017-11-09T09:08:17Z",
      "updated_at": "2017-11-09T09:08:17Z",
      "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": "2017-11-09T09:08:17Z",
      "updated_at": "2017-11-09T09:08:17Z",
      "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": "2017-11-09T09:08:17Z",
      "updated_at": "2017-11-09T09:08:17Z",
      "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": "2017-11-09T09:08:17Z",
      "updated_at": "2017-11-09T09:08:17Z",
      "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