Messaging API quick guide
If you're a Managed Affiliate Partner, you can start testing the Messaging API in your application today.
This guide helps you try out the Messaging API in 15–30 minutes using our dedicated test hotel with automated replies.
- Purpose: Quickly try out the Messaging API.
- When to use: You want to test post-booking communication flows.
- You'll learn how to:
- Create a test booking and trigger auto-replies.
- Retrieve an automated welcome message.
- Confirm receipt.
- Code samples: Minimal, only required fields.
Before you start
Make sure you:
- Are a Managed Affiliate Partner.
- Complete the Demand API prerequisites.
You'll need:
✓ A valid API key token.
✓ Your X-Affiliate-Id.
✓ Access to the sandbox environment.
Every Messaging API request must be authenticated with your Demand API v3.1 credentials.
Test setup
The Messaging Test Hotel is preconfigured with automated replies, such as:
- Welcome message after booking confirmation.
- Rejections for requests like extra beds or parking.
Note: Real accommodations can configure their own auto-replies via Booking.com’s Extranet messaging centre.
Try it out — minimal flow
book → get a message → confirm receipt.
Step 1 - Create a test order
Make a reservation at Demand API Messaging Test Hotel (ID 13921698) via /orders/preview and orders/create.
Always provide a valid test credit card in the payment field; otherwise your booking request will fail.
See Testing payments and the orders/create guide for instructions on how to make a booking.
When successful, the orders/create response includes:
{
"data": {
"accommodation": {
"reservation": "6066547158",
"order": "5006302528200239",
"pincode": "884512"
}
}
}
→ Use the reservation
id to fetch conversations and send messages.
Step 2 - Retrieve the welcome message
After the booking is confirmed, the Demand API Messaging Test Hotel automatically sends a welcome message.
- Guest view: The welcome message appears in the guest’s email (or registered app).
- Accommodation view: The property sees the booking and message in the Booking.com Extranet messaging centre.
Example in Booking.com Extranet messaging centre:
Accommodation hosts can use Booking.com Extranet messaging centre or any other channel to communicate with guests.
→ Call /messages/latest endpoint to fetch the automated welcome message.
Request:
- You don't need to provide parameters; just send an empty body POST request.
Response:
{
"data": {
"messages": [
{
"content": "Hello, thanks for booking Demand API Test Hotel!",
"timestamp": "2025-07-29T12:04:05.466Z"
}
]
}
}
Step 3 - Confirm receipt
After processing, confirm messages with /messages/latest/confirm.
Request:
{
"messages":["3f986fc8-b944-4501-b8d1-430e833ca756"]
}
When successful, the response returns HTTP 200 OK.
Next steps
This was the minimal flow: book → get a message → confirm receipt.
- For full messaging scenarios — including sending messages, handling rejections, and troubleshooting — see the Manage messages guide
- Check the Manage attachments guide to learn how to send/download images.
- Review Best practices to align your messaging flows.