Last updated

Manage photos

This section of Key Collection API contains information about managing photos for your Key Collection instructions. Working with photos on Key Collection API consists of two parts:

  1. Uploading photos, getting the photo_id
  2. Attaching photos to a check-in method using photo_id as a reference

Upload a photo

HTTP Request

POST https://supply-xml.booking.com/checkin-methods-api/properties/{property_id}/photos

Fields

NameTypeValue
photoFileMust contain the photo you want to upload

Request headers

HeaderDescriptionValueRequiredNotes
Content-TypeIn order to upload photos on this endpoint - Content-Type header must be passedapplication/x-www-form-urlencodedtrue---
AuthorizationMachine account username and passwordstringRequiredExample: Authorization: Basic {username:password}

Response

Response contains a json, your new uploaded photo will be presented in photo_ids array

Response example

    {
        "meta": {
            "ruid": "UmFuZG9tSVYasd2lIyh9YYzJxQACCf/WArprs1HzULoKFiaTZ3gIQEzdREHlF9LnIz6xoC0bhUAvdq5GjORwbvTaGI7Ey2/O"
        },
        "warnings": [],
        "errors": [],
        "data": {
            "photo_ids": [
                123
            ]
        }
    }

Retrieve uploaded photos

HTTP Request:

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

Request headers

HeaderDescriptionValueRequiredNotes
Content-TypeIn order to upload photos on this endpoint - Content-Type header must be passedapplication/x-www-form-urlencodedtrue---
AuthorizationMachine account username and passwordstringRequiredExample: Authorization: Basic {username:password}

Response

Response contains an array, each array element contains photo_id and photo_uri fields representing an uploaded photo

Response example

    {
        "warnings": [],
        "data": [
            {
                "photo_id": 123,
                "photo_uri": "//static.booking.com/xdata/images/xphoto/max500_ao/57216095.jpg?k=280e1523ebc975708b48c3c9de6c064fb96485e6be90985aaa0351566835f776&o="
            },
            {
                "photo_uri": "//static.booking.com/xdata/images/xphoto/max500_ao/57848102.jpg?k=e57d1fe37cc4d46c7add801ebabb6d05aff1e37f7cda7e15dbe3f5fd05ed1014&o=",
                "photo_id": 124
            }
        ],
        "meta": {
            "ruid": "UmFuZG9tSVYjo2RlIyh9YbqQxe6QcDUTafvjC+xCLwshvFuPlqvaPgbBDxhJ4x5a3F8cmiGKQIWT4vmDUl3N0VaHZEOhH7C3GyNZ8PxFq3o="
        },
        "errors": []
    }

Delete a photo

HTTP Request

DELETE https://supply-xml.booking.com/checkin-methods-api/properties/{property_id}/photos/{photo_id}

Fields

NameTypeValueNotes
photo_idIntegerID of the photo that you want to deleteThis parameter is expected to be passed within the request string

Response

Response contains a "success" flag indicating that request finished successfully

Response example

    {
        "errors": [],
        "meta": {
            "ruid": "UmFuZG9tSVYkc2RlIyh9YbqQxe6QcDUTTZ4sRDRSRagVHjGtDkDoKaBrqkNvwwUoEZwEmB9l9LgB5KqgEv6Fuu0w69yZOzvpdoxP06mk2XI="
        },
        "data": {
            "success": 1
        },
        "warnings": []
    }