Skip to content

Upload attachment

Request

Use this endpoint to upload a file to be used as a message attachment. The response includes an attachment ID to reference when sending messages.

Security
BearerAuth
Headers
X-Affiliate-Idintegerrequired

Include here your Affiliate identifier number

Bodyapplication/json
conversationstring(conversation)required

The unique identifier of the conversation

accommodationstring(accommodation-2)required

The unique identifier of the property

file_sizeinteger, (int64), <= 1048576required

The file size in bytes.

file_namestringrequired

The original file name including extension.

file_typestringrequired

The MIME type of the attachment (supported formats: PNG, JPEG, JPG).

file_contentstring, base64required

Base64-encoded content of the attachment.

curl -i -X POST \
  https://demandapi.booking.com/3.2/messages/attachments/upload \
  -H 'Authorization: Bearer <YOUR_string_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'X-Affiliate-Id: 0' \
  -d '{
    "accommodation": 6819547,
    "conversation": "8586a789-44f4-5521-9f27-f5efd097cba6",
    "file_size": 17580,
    "file_name": "a3e062a0-3e6b-4592-9df2-64cf83688084.jpg",
    "file_type": "image/jpeg",
    "file_content": "/9j/4AAQSkZJRgABAQACWAJYAAD/2wCEAAgGBgc"
  }'

Responses

Successful response.

Bodyapplication/json
request_idstring(requestId)

Uniquely identifies the request. Please provide this identifier when contacting support.

dataobject
Response
{ "request_id": "c249e7b6-be70-411b-bcb7-0c2d49313199", "data": { "attachment": "695b7f90-2c08-11f0-9cee-134ca9b067d1" } }