Retrieve photos

After a queued photo finishes uploading, you can use the /photos endpoint to retrieve its metadata. You can then use this data to arrange photos in galleries.


Retrieve photo metadata

HTTP request

GET https://supply-xml.booking.com/photo-api/properties/{property_id}/photos/{photo_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": {
    "name": "original_125772783.jpg",
    "photo_id": "8-NjAmvGUuY",
    "url": "https://supply-xml.booking.com/photo-api/properties/1234567890/photos/8-NjAmvGUuY",
    "sample": "https://example.com/8ef/8ef267492f453018befb28391c641bb0c993ef32.jpg",
    "height": 960,
    "width": 1440,
    "tag_ids": [1, 3, 7],
    "in_property_gallery": {
      "property_id": 1234567890,
      "url": "https://supply-xml.booking.com/photo-api/properties/1234567890/gallery"
    },
    "in_room_galleries": [
      {
        "room_id": 123456789002,
        "url": "https://supply-xml.booking.com/photo-api/properties/1234567890/rooms/123456789002/gallery"
      }
    ]
  },
  "meta": {
    "ruid": "UmFuZG9tSVYkc2RlIyh9YWFOqyMkTMAreuCQEh5uXaBtUCNfQh5H7s59v9v3HswKuMitZoGvAfLlPYkWtW3ohDrMvfLJAzlLeBZ1LKUVBNo="
  },
  "errors": [],
  "warnings": []
}

See Photo API reference for details.


Retrieve metadata of all photos

HTTP request

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

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": {
    "photos": [
      {
        "photo_id": "7Q1IREzv-P0",
        "name": "original_125772780.jpg",
        "width": 1440,
        "height": 960,
        "url": "https://supply-xml.booking.com/photo-api/properties/1234567890/photos/7Q1IREzv-P0",
        "sample": "https://example.com/path/max500_watermarked_standard/e77/e7742a01c8a3a8a038b7e0ada1b597124800ab94.jpg",
        "tag_ids": [1, 3, 7],
        "in_property_gallery": null,
        "in_room_galleries": [
          {
            "url": "https://supply-xml.booking.com/photo-api/properties/1234567890/rooms/123456789002/gallery",
            "room_id": 123456789002
          }
        ]
      },
      {
        "photo_id": "8-NjAmvGUuY",
        "name": "original_125772783.jpg",
        "url": "https://supply-xml.booking.com/photo-api/properties/1234567890/photos/8-NjAmvGUuY",
        "sample": "https://example.com/path/max500_watermarked_standard/8ee/8ee267492f453018befb28391c641bb0c993ef35.jpg",
        "width": 1440,
        "height": 960,
        "tag_ids": [1, 8, 17],
        "in_property_gallery": {
          "url": "https://supply-xml.booking.com/photo-api/properties/1234567890/gallery",
          "property_id": 1234567890
        },
        "in_room_galleries": [
          {
            "room_id": 123456789002,
            "url": "https://supply-xml.booking.com/photo-api/properties/1234567890/rooms/123456789002/gallery"
          }
        ]
      }
    ]
  },
  "meta": {
    "next_page": "https://supply-xml.booking.com/photo-api/properties/1234567890/photos?cursor=UkQAAAAbAAAAAaA7-M_WOjCg6wlbfvCIE_CziAcfTvH0MrsgzDpyR2t3byjFFeUTTzt5aoulwH6sU9LzvqKf44TE2wLHDw",
    "ruid": "UmFuZG9tSVYkc2RlIyh9YWFOqyMkTMArQ8j4RHj1y73YowTqnhZhQ5lSBWXHp+al1oKXqiHL37AvlKkYfdGJAW7o+oaoEKqk+uM5C9HPPn0="
  },
  "warnings": [],
  "errors": []
}

See Photo API reference for details.


Delete a photo

Bulk delete not supported

You can only delete one photo at a time. Your request must always include a photo_id. Using DELETE /photo-api/properties/{property_id}/photos will return error HTTP 405.

You can only delete the property's main photo if the property is closed

If you try to remove the open property's main photo you will get an error. To delete the main photo for open property, you need to set a different main photo first.

Use this endpoint to delete or permanently remove a photo. This will remove the photo from all the associated galleries. This operation is not reversible, once a photo is deleted you need to upload the photo again.

HTTP request

DELETE https://supply-xml.booking.com/photo-api/properties/{property_id}/photos/{photo_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

If the request was successful you will get the following response.

{
  "data": {
    "success": 1
  },
  "errors": [],
  "meta": {
    "ruid": "UmFuZG9tSVYkc2RlIyh9YQUrOThXN/oqVMumdc9B5QdAneVkZDLauuIPkoD5f2I5e4Ck+SIXzBmeoOLGPupPZoJJaHgR0v0huOR+e/09HJd+AasYDki84Q=="
  },
  "warnings": []
}

If the photo you are trying to delete does not exist, you will receive a response similar to the one below.

{
  "errors": [
    {
      "code": "OBJECT_NOT_FOUND",
      "details": {
        "expected_type": [
          "PhotoReferenceInput"
        ],
        "id": [
          "987654321"
        ]
      },
      "message": "Object not found"
    }
  ],
  "meta": {
    "ruid": "UmFuZG9tSVYkc2RlIyh9YdTxUSz/FEhJDu4ERIDUiTYcIJRWb7XKx01gM5bhoF6Z2ZFqJqsSs+KHnWbOeUMgQ3qS0hfmPdwZgKg6s/xnj1VyzTtIr0Zn2Q=="
  },
  "warnings": []
}

See Photo API reference for details.