Skip to content

Upload an attachment

Request

Uploads 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/jsonrequired
conversationstringrequired

Unique identifier of the conversation.

accommodationstringrequired

Unique identifier of the property.

file_sizeintegerrequired

Size of the file in bytes.

file_namestringrequired

Original file name including extension.

file_typestringrequired

MIME type of the file.

file_contentstringrequired

Base64-encoded content of the file.

curl -i -X POST \
  https://demandapi.booking.com/3.1/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"
  }'