# Use case 2 - Send request & handle rejection

**This use case demonstrates how to send a special request to the accommodation and retrieve the automatic rejection message programmatically.**

> **Scenario:** *A guest requests an extra bed at the Messaging Test Hotel (ID 13921698). The system automatically sends a predefined rejection message, which the partner retrieves via the Messaging API.*


div
strong
 ⏱️ Estimated time to complete:
 15–30 minutes

## Workflow steps

This workflow has 4 steps:

[1. Send the request message.](#step-1---send-the-request-message)
[2. Accommodation receives the message.](#step-2---accommodation-receives-the-message)
[3. Guest receives the rejection.](#step-3---guest-receives-rejection)
[4. Poll latest messages programmatically.](#step-4---poll-latest-messages-programmatically)

### Step 1 - Send the request message

Use [messages/send ](/demand/docs/open-api/demand-api/messages/sendmessage) to send a message to the accommodation:


```json
{
  "reservation": "6066547158",
  "accommodation": "13921698",
  "content": "I would need an extra bed in the room, is this possible? Thanks"
}
```

When successful, the response includes a `message` id that identifies the sent message:


```json
{
  "data": {
    "message": "ce18cdf0-8fb5-11f0-9aad-81db133940ac"
  },
  "request_id": "6483bacb-41a6-4f18-8747-9f04f40f2f45"
}
```

### Step 2 - Accommodation receives the message

The accommodation host receives the request via the Booking.com Extranet messaging centre.

Since the Demand API Messaging Test Hotel has a pre-defined rejection for extra bed requests, an automatic rejection message is generated.

![message sent ](/assets/special-request-bed.e8a01bb69f74730a6967788aeab5378f607450e75a18eb523fc328bc318869f3.a0931a69.png)

Example of the automatic rejection message:

![rejected request](/assets/rejected-request.e83bd7b88a73ccbcfb818960e39c5ccd4cf37ad0507f33f977de9fbb7edba864.a0931a69.png)

### Step 3 - Guest receives rejection

The guest receives the rejection message in their email or registered app.

If the guest has a Booking.com account, they can also access the full conversation history in the Booking.com platform.

![messages guest](/assets/messages-guest.34b3b7b9658c9002f011709bb94398a3d5d3bd2aa93d5b3899d9c88174bc9757.a0931a69.png)

### Step 4 - Poll latest messages programmatically

To retrieve the rejection message without manually checking the guest’s inbox, use the [/messages/latest endpoint](/demand/docs/open-api/demand-api/messages/fetchlatestmessages) endpoint.

See [Use case 1 - Step 2](#step-2---poll-messages-programmatically) for more details.

## Next steps

After completing these workflows, you can:

* Integrate automated responses into your system.
* Monitor conversations and ensure all messages are confirmed.
* Explore advanced features such as attachments and conversation history.


Curious to know more?
* Read the [Manage attachments guide](/demand/docs/messaging/manage-attachments) to learn how to send and download images.
* Review [Messaging best practices](/demand/docs/messaging/messaging-best-practices) to align your messaging flows.
* Check the [Messaging troubleshooting guide](/demand/docs/messaging/messaging-troubleshooting) for help with error resolution.