Upload photos

To upload new photos, you must add them to the queue. We then run some tests, such as duplicate checks. If the tests succeed, you can add the photos to a gallery.

photo_id, photo_pending_id & photo_batch_id

When you queue a batch of photos, we assign that batch a photo_batch_id. We also give each individual photo in the batch a temporary photo_pending_id. You can use these IDs to check the status of a batch or individual photo.

After a photo passes our tests, we assign it a permanent, unique photo_id. Use this photo_id for further operations, such as adding a photo to a gallery.

The photo_pending_id disappears after 7 days.


Add photos to queue

HTTP request

POST https://supply-xml.booking.com/photo-api/properties/{property_id}/pending/photos/{photo_pending_id}

Request headers

Header Description Type Required Notes
Authorization Machine account username and password string Required Example: Authorization: Basic {username:password}

Request body

{
  "photos": [
    {
      "url": "http://example.image.com/example_image_01.jpg",
      "tags": [
        "beach",
        "swimming_pool"
      ]
    },
    {
      "url":"http://example.image.com/example_image_02.jpg",
      "tags":[
        "restaurant"
      ]
    }
  ]
}

See Photo API reference for details.

Response body

{
    "data": {
      "photo_batch_id": "N_rVh0sK6wI"
    },
    "meta": {
        "ruid": "UmFuZG9tSVYkc2RlIyh9Yb6ToEKUv9VcWwaZQWB/kI/9XRt0IBvKGP54DLARQ9OvgIz8zi5UKxHWYbAGlHfhRt7RAbwCPS868uNWfkiDT1I="
    },
    "warnings": [],
    "errors": []
}

See Photo API reference for details.


Retrieve batch status by photo_batch_id

Example of retrieving the processing status of pending photos with photo_batch_id=N_rVh0sK6wI.

HTTP request

GET https://supply-xml.booking.com/photo-api/properties/{property_id}/pending/photos?photo_batch_id={photo_batch_id}

Request headers

Header Description Type Required Notes
Authorization Machine account username and password string Required Example: Authorization: Basic {username:password}

Request body

This request has no body. All parameters are specified in the path.

See Photo API reference for details.

Response body

{
    "data": [
      {
        "url": "http://example.image.com/example_image_01.jpg",
        "request_timestamp": "2018-06-22 10:38:58",
        "status": "new",
        "photo_pending_id": "tnQs69gYd_o"
      },
      {
        "status": "new",
        "photo_pending_id": "oJgwI5LhE3s",
        "request_timestamp": "2018-06-22 10:38:58",
        "url": "http://example.image.com/example_image_02.jpg"
      }
    ],
    "meta": {
        "next_page": "https://supply-xml.booking.com/photo-api/properties/3374627/pending/photos/?photo_batch_id=N_rVh0sK6wI&after=oJgwI5LhE3s",
        "items_retrieved": 2,
        "hotel_id": "3374627",
        "limit": 100,
        "ruid": "UmFuZG9tSVYkc2RlIyh9Yaf+UcT6KAbCBwplV7qrRifGx4G3hJj5vYPE2lRDMn/PY7kGj6NUywN4V0adQXPG8z9Ew8An3RkUD2pX0yeUCBM="
    },
    "errors": [],
    "warnings": []
}

See Photo API reference for details.


Retrieve status of all batches

A GET request without a photo_batch_id returns all previously sent photo upload requests for a property. Use start_date to retrieve requests created on or after a certain date.

Upload request lifetime

Completed photo uploads expire after 7 days, which means they will no longer be included in the response. You can still retrieve uploads older than 7 days by specifying a specific photo_batch_id or photo_id.

HTTP request

GET https://supply-xml.booking.com/photo-api/properties/{property_id}/pending/photos?start_date={YYYY-MM-DD}

Request headers

Header Description Type Required Notes
Authorization Machine account username and password string Required Example: Authorization: Basic {username:password}

Request body

This request has no body. All parameters are specified in the path.

See Photo API reference for details.

Response body

{
    "data": [
        {
            "status": "new",
            "photo_pending_id": "tnQs69gYd_o",
            "request_timestamp": "2018-06-22 10:38:58",
            "url": "http://example.image.com/example_image_01.jpg"
        },
        {
            "status": "ok",
            "photo_pending_id": "oJgwI5LhE3s",
            "photo_id": "fklD4gkl32",
            "request_timestamp": "2018-06-22 10:38:58",
            "url": "http://example.image.com/example_image_02.jpg"
        }
    ],
    "meta": {
      "limit": 100,
      "ruid": "UmFuZG9tSVYkc2RlIyh9Yb6ToEKUv9Vc+ekaaV5YR21O34VxTP222jwNovIjdWnoklSigfkA1HSD2V+scpDJLfNVn5I/y9j+Ebws0qhyzAo=",
      "next_page": "https://supply-xml.booking.com/photo-api/properties/1234567890/pending/photos/?after=oJgwI5LhE3s",
      "start_date": "2018-06-15",
      "items_retrieved": 2,
      "hotel_id": "1234567890"
    },
    "errors": [],
    "warnings": []
}

See Photo API reference for details.

Empty responses

The response consists of a JSON array. An empty array indicates no data.


Retrieve photo status by photo_pending_id

Send a GET request with a photo_pending_id in the path to retrieve the status of a single photo.

HTTP request

GET https://supply-xml.booking.com/photo-api/properties/{property_id}/pending/photos/{photo_pending_id}

Request headers

Header Description Type Required Notes
Authorization Machine account username and password string Required Example: Authorization: Basic {username:password}

Request body

This request has no body. All parameters are specified in the path.

See Photo API reference for details.

Sample response

{
    "data":{
        "id":"ABCDEF123456",
        "request_timestamp":"1514764800",
        "url":"http://example.image.com/example_image_01.jpg",
        "status":"ok",
        "photo_id":"XYZXYZ987654321"
    },
    "errors":[],
    "warnings":[],
    "meta":{}
}

See Photo API reference for details.