Learn how to send a special request to a property, retrieve its automated rejection and confirm receipt using the Messaging API.
This use case demonstrates how to handle a guest request that cannot be fulfilled by the property, using the Demand API Messaging Test Hotel in the sandbox environment.
Scenario: A guest requests an extra bed at the Demand API Messaging Test Hotel (accommodation ID
13921698). The property is configured to send an automated rejection for this type of request. Your integration sends the request, retrieves the rejection message and confirms receipt.
Make sure you have:
- Completed Use case 1 – Booking and welcome message.
- Access to the sandbox environment.
- Valid Demand API credentials and your
X-Affiliate-Id. - Access to the Messaging API.
- An existing reservation at the Demand API Messaging Test Hotel (
13921698). - The
conversationID associated with the reservation.
All Messaging API requests require Bearer authentication and the X-Affiliate-Id header.
For more information, see Authentication.
To send a message, you need the conversation ID associated with the reservation.
You can retrieve it using /messages/conversations, as explained in Use case 1 – Step 1.
Follow these four steps to complete the scenario:
- Send the guest request to the property.
- Receive the automated rejection generated by the test hotel.
- Retrieve the rejection message using the Messaging API.
- Confirm message receipt to continue receiving new messages.
Use /messages/send to send an extra-bed request to the Demand API Messaging Test Hotel.
The endpoint requires:
| Field | Description |
|---|---|
accommodation | Unique identifier of the property associated with the conversation. |
conversation | Unique identifier of the existing conversation. |
content | Plain-text content of the message. |
Request
POST /messages/send
{
"accommodation": "13921698",
"conversation": "bbb76179-7565-5a23-8632-33e164aa13db",
"content": "I would need an extra bed in the room. Is this possible? Thanks!"
}In this example:
accommodationidentifies the Demand API Messaging Test Hotel.conversationidentifies the existing conversation associated with the guest's reservation.contentcontains the guest's extra-bed request.
The /messages/send endpoint requires a conversation ID, not a reservation ID.
Use the conversation ID retrieved in Use case 1.
{
"request_id": "6483bacb-41a6-4f18-8747-9f04f40f2f45",
"data": {
"message": "ce18cdf0-8fb5-11f0-9aad-81db133940ac"
}
}A successful request returns HTTP 200 OK.
The data.message field contains the unique identifier of the sent message.
The guest request has been sent to the existing conversation.
The test accommodation can now process the request and generate its automated response.
The Demand API Messaging Test Hotel is configured to automatically reject certain guest requests, including requests for extra beds.
After your integration sends the message:
- The request becomes available to the property through the Booking.com messaging platform.
- The test accommodation generates a predefined rejection response.
- The rejection message becomes available through the conversation.
The property can view the guest's request in the Booking.com Extranet messaging centre.
Example of an extra-bed request:

The test accommodation automatically generates a rejection message.
Example of the automated rejection:

Depending on the communication setup, the guest may receive the rejection through the Booking.com app, website or email notifications.
The guest can also view the conversation through the available Booking.com communication channels.
Example of the guest conversation:

These automated responses are specific to the Demand API Messaging Test Hotel.
Real properties may handle guest requests manually or through their own automated messaging configurations.
Use /messages/latest to retrieve the automated rejection programmatically.
This allows your integration to process the response without requiring the guest to check their email or Booking.com account.
Request
POST /messages/latest
Send an empty JSON object:
{}{
"request_id": "ddcf96b3-e17c-4e6f-8f8c-4d685489ce04",
"data": {
"messages": [
{
"conversation": {
"id": "bbb76179-7565-5a23-8632-33e164aa13db",
"reservation": "6066547158",
"accommodation": "13921698"
},
"content": "Unfortunately, we cannot provide an extra bed for your reservation.",
"id": "8a269910-19d1-11f0-bb60-972708bd278a",
"sender": {
"participant": "94914645-adbc-546b-a759-d1a1b48b6e1e",
"metadata": {
"type": "property",
"name": "Demand API Messaging Test Hotel"
}
},
"attachments": [],
"timestamp": "2026-09-18T12:35:40.000Z"
}
]
}
}The response includes:
| Field | Description |
|---|---|
conversation | Identifies the conversation, reservation and accommodation associated with the message. |
content | Plain-text content of the rejection message. |
id | Unique identifier of the message. Use this ID to confirm receipt. |
sender | Identifies the sender and provides participant metadata. |
attachments | Array of attachment IDs, if any. |
timestamp | Date and time when the message was sent, in ISO 8601 format. |
By default, /messages/latest returns up to 100 messages in reverse chronological order, with the newest messages first.
The /messages/latest endpoint returns recent messages available to your affiliate account, not only messages associated with the test reservation.
Use conversation.id, conversation.reservation and conversation.accommodation to identify the rejection message associated with your guest request.
After retrieving the message:
- Identify the conversation associated with the guest's request.
- Check that the message was sent by the property.
- Process the rejection message according to your application's communication workflow.
- Make the response available to the guest through the appropriate channel.
- Save the message ID for receipt confirmation.
Automated responses might not be available immediately after sending a request.
If the expected rejection is not returned, wait before polling again. Follow the applicable Demand API rate limits.
After successfully processing the rejection message, use /messages/latest/confirm to confirm receipt.
Confirmation is required to continue receiving new messages through /messages/latest.
Request
POST /messages/latest/confirm
Provide the message ID returned in Step 3.
{
"messages": [
"8a269910-19d1-11f0-bb60-972708bd278a"
]
}Example response
{
"request_id": "cdb0b154-2eae-481b-8fee-fb2725296e1f",
"confirmedMessages": [
"8a269910-19d1-11f0-bb60-972708bd278a"
]
}A successful request returns HTTP 200 OK.
The confirmedMessages array contains the IDs of messages confirmed by the API.
Compare the returned IDs with those submitted in the request to determine which messages were confirmed.
Only confirm messages after your application has successfully processed them.
If a message ID is missing from confirmedMessages, do not assume that its receipt was confirmed.
You've completed the request and rejection workflow:
- Sent an extra-bed request to the test accommodation.
- Retrieved the automated rejection message.
- Processed the response in your application.
- Confirmed message receipt.
Your integration can now continue polling /messages/latest for subsequent messages.
Follow these recommendations when handling guest requests and automated responses:
✅ Use the correct conversation: Include the accommodation and conversation IDs associated with the guest's reservation.
✅ Track message IDs: Store the IDs of sent and received messages to support reliable message processing.
✅ Identify the sender: Use the sender metadata to distinguish property responses from guest messages.
✅ Associate responses with reservations: Use the conversation identifiers to match incoming messages to the correct booking.
✅ Confirm messages after processing: Call /messages/latest/confirm only after successfully processing the received messages.
✅ Check confirmation results: Compare submitted message IDs with confirmedMessages before marking messages as confirmed.
✅ Avoid excessive polling: Allow time for automated responses and follow the applicable Demand API rate limits.
✅ Handle errors appropriately: Validate requests and apply suitable retry strategies without generating duplicate messages.
- Use case 1 – Booking and welcome message – Retrieve a booking conversation, receive an automated welcome message and send a reply.
- Manage messages – Review messaging operations and communication workflows.
- Manage attachments – Learn how to upload, send and retrieve image attachments.
- Messaging best practices – Review recommendations for reliable messaging integrations.
- Messaging troubleshooting – Learn how to troubleshoot common messaging issues.