Your task is to use the context that was given and to output it in markdown format and clean it up.
Remove the following:
- image links
- this page helpful parts
- grid layout where mentioned
- mentioned imports like import { WasThisPageHelpful } from '@components/WasThisPageHelpful' and other react references/info
- any react components or html tags and keep only the text

Other instructions:
-don't change wording, word order, words itself or add any punctuation 
-do not change any of the content meaning and facts, just clean up the formatting and convert to markdown 
-if you see selectwrapper with options, just combine with the table below it and render it as markdown info 
-if you get table in md format, don't change anything in it 
-if you see any text in the format [text](link), leave it in the same place, dont change it or move it 
-remove imports from the top of the file like import { WasThisPageHelpful } from '@components/WasThisPageHelpful' and other react references/info if they exist 
-do not put duplicated content and do not put notes about duplicated content 
-do not change the text enclosed in '---' at the beginning of the file, it is used for metadata 
-do not explain what you did, just output the result 
-return full file, don't skip or remove anything that is not mentioned in the instructions 
:/# Send a message  

After you have defined the message type(s) and channel(s) to use for your communication, use the [send a Messages API message](https://www.infobip.com/docs/api/platform/messages-api/sending-message/send-messages-api-message) to create your request.
  
Depending on the channels and message type you use, remember to add additional options to your send request.

## Validate Messages API request

The Messages API supports request validation using a dedicated endpoint. This endpoint allows you to test your message payload before sending it, ensuring that it meets the necessary requirements for each channel. By validating requests in advance, you can catch potential issues early and receive detailed feedback on resolving them.
This feature is particularly useful when dealing with multiple channels in a single request, as each channel has specific requirements. The validation endpoint provides more granular feedback, such as validating messages against standalone API, applying additional checks for each failover step, and flagging unknown fields.

### Validation endpoint [#validation-endpoint-validate-messages-api-request]

This endpoint enables you to perform a detailed validation of Messages API requests. It provides immediate feedback on whether your message payload is valid for submission to the platform. If the request is valid, the endpoint will return ```200 OK```. If there are issues, it will return ```400 BAD REQUEST``` response with information on what needs to be fixed.

To validate your request, follow the steps below:

1. Send a `POST` request to the validation endpoint (`POST` ```/resource-management/1/messages/validate```) with your message payload.
2. If the message passes validation, you will receive a ```200 OK``` response, indicating it is ready for submission.
3. If validation fails, you will receive a ```400 BAD REQUEST``` response with details on the errors.

**Sample request**

```json showLineNumbers copy filename="json"
{
  "messages": [
    {
      "channel": "SMS",
      "sender": "447491163443",
      "destinations": [
        {
          "to": "111111111"
        }
      ],
      "content": {
        "body": {
          "text": "May the Force be with you.",
          "type": "TEXT"
        }
      }
    }
  ]
}
```
**Example error response**

```json showLineNumbers copy filename="json"
{
  "description": "Request cannot be processed.",
  "action": "Check the syntax, violations and adjust the request.",
  "violations": [
    {
      "property": "messages[0].content.body",
      "violation": "invalid value"
    }
  ]
}
```

**Additional features of endpoint validation**:

- **Standalone API model validation**: Ensure your message conforms to the standards set by each standalone API.
- **Failover checks**: Verify that each failover step is properly configured.
- **Unknown field detection**: Flags any fields that could cause issues when sending the request.

Note
The validation endpoint does not send any messages. It only checks the validity of your payload.

For more technical details on endpoint validation, please refer to our [API documentation](https://www.infobip.com/docs/api/platform/messages-api/sending-message/validate-messages-api-message).

## adaptationMode

Note
The **default behavior** of the Messages API is now `adaptationMode=true`. This means the API will automatically try to adapt messages to fit natively unsupported message types in supported formats of each channel unless explicitly disabled. With `adaptationMode` enabled, the API will adjust the message so it can be sent. However, due to the fact that the API will transform adaptable elements into similar, supported elements, the message can look slightly different.

The `adaptationMode` parameter in the Messages API allows you to send and deliver messages even if they contain elements that specified channels do not support.

By default, `adaptationMode` is enabled, meaning that the API will automatically adapt messages to fit the capabilities of the recipient channel to ensure successful delivery. The adaptable message elements will get transformed, while non-adaptable elements will be skipped.

**Examples of adaptation**

- If the header is not supported by the channel, the API will merge the header and body into one message, meaning it will format header as the first line and then new line with the text following.
- If an image is not supported natively, the API will send the URL to it as part of the text instead (for example, it will get added as a plain text in the message).
- If a button is not supported natively by the channel and it cannot be adapted, it will be skipped.

When `adaptationMode` is disabled (set as `false`), the API does not adapt the message. If the message contains elements that the channel does not support, it will be rejected and will return an error.

The default behavior ensures that messages are delivered whenever possible. However, if you need precise control over message formatting and prefer to receive an error when elements are not supported, you can disable this feature by setting `adaptationMode` from `true` to `false` in your API request.

**Example request with `adaptationMode` enabled (default behavior)**

```json showLineNumbers copy filename="json"

{
  "messages": [
    {
      "channel": "WHATSAPP",
      "sender": "441234567890",
      "destinations": [
        {
          "to": "440987654321"
        }
      ],
      "content": {
        "body": {
          "text": "Thank you for joining us on Athleete Unlocked! Would you like to subscribe for future Athleete events?",
          "type": "TEXT"
        },
        "buttons": [
          {
            "type": "REPLY",
            "text": "Yes",
            "postbackData": "true"
          },
          {
            "type": "REPLY",
            "text": "No",
            "postbackData": "false"
          }
        ]
      }
    }
  ]
}
```

**Output**

### Disabling adaptationMode [#disabling-adaptation-mode-adaptationmode]

If you do not want the API to adapt your messages and would prefer to receive errors when elements are not supported, you need to explicitly set `adaptationMode` to `false` in your API request.

**Example request with `adaptationMode` disabled**

```json showLineNumbers copy filename="json"

{
  "messages": [
    {
      "channel": "SMS",
      "sender": "441234567890",
      "destinations": [
        {
          "to": "440987654321"
        }
      ],
      "content": {
        "body": {
          "text": "Here is a link to our latest updates!",
          "type": "TEXT"
        },
        "buttons": [
          {
            "type": "OPEN_URL",
            "text": "Visit",
            "url": "https://example.com"
          }
        ]
      },
      "options": {
        "adaptationMode": false  // Explicitly disabling adaptation
      }
    }
  ]
}
```

In this example, the API will return an error if the channel does not support buttons (for example, SMS).

### Supported message types [#supported-message-types-adaptationmode]

| Messaging channel | Text | Image | Video | Document | Rich link | Auth request | List | Carousel | Templates |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Apple Messages for Business | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅* |
| Instagram Direct | ✅ | ✅ | 🔄 | 🔄 | ✅ | ❌ | 🔄 | ✅ | ❌ |
| LINE | ✅ | 🔄 | 🔄 | 🔄 | ❌ | ❌ | ❌ | ❌ | ❌ |
| Messenger | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | 🔄 | ✅ | ❌ |
| MMS | ✅ | ✅ | ✅ | ✅ | 🔄 | ❌ | ❌ | ❌ | ❌ |
| RCS | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | 🔄 | ✅ | ✅* |
| SMS | ✅ | 🔄 | 🔄 | 🔄 | ❌ | ❌ | ❌ | ❌ | ❌ |
| Viber Bots | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | 🔄 | ✅ | ❌ |
| Viber Business Messages | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| WhatsApp | ✅ | ✅ | ✅ | ✅ | 🔄 | ❌ | ✅ | ❌ | ✅ |

**Explanation**

✅: indicates that the channel natively supports the element and the message will be delivered as-is.

❌: indicates that the element is not supported, and an error will be returned (`adaptationMode` cannot adapt the element).

🔄: indicates that the channel does not support element natively, but `adaptationMode` can convert it (skip/adapt non-supported fields) into a simpler and natively supported format (for example, text or URL).

\* for **Apple Messages for Business templates** and **RCS templates**, only Text templates are supported.

Note
With `adaptationMode` set to `true`, the API will try to adapt messages to fit the limitations of different messaging channels, ensuring that messages are sent even if the channel does not support all elements. However, in cases of certain strict channel rules and exceptions (for example, button limits and required text), the `adaptationMode` will not be able to override them and you will get an error returned.

### Buttons [#buttons-adaptationmode]

| Messaging channel | adaptationModeset totrue | adaptationModeset tofalse |
| --- | --- | --- |
| Apple Messages for Business | TextButtons (separate message) | TextButtons (separate message) |
| Instagram Direct | Text with buttons | Text with buttons |
| LINE | Text with buttons | Text with buttons |
| Messenger | Text with buttons | Text with buttons |
| MMS | Text | Error: Buttons not supported |
| RCS | Text with buttons | Text with buttons |
| SMS | Text | Error: Buttons not supported |
| Viber Bots | Text with buttons | Text with buttons |
| Viber Business Messages | Text with buttons | Text with buttons |
| WhatsApp | Text with buttons | Text with buttons |

### Image [#image-adaptationmode]

| Messaging channel | adaptationModeset totrue | adaptationModeset tofalse |
| --- | --- | --- |
| Apple Messages for Business | ImageImage caption | ImageImage caption |
| Instagram Direct | ImageImage caption | ImageImage caption |
| LINE | Image captionURL of the image | Error: Image not supported, but adaptable |
| Messenger | ImageImage caption | ImageImage caption |
| MMS | ImageImage caption | ImageImage caption |
| RCS | ImageImage caption | ImageImage caption |
| SMS | Image captionURL of the image | Error: Image not supported, but adaptable |
| Viber Bots | ImageImage caption | ImageImage caption |
| Viber Business Messages | ImageImage caption | ImageImage caption |
| WhatsApp | ImageImage caption | ImageImage caption |

### Image with header [#image-with-header-adaptationmode]

| Messaging channel | adaptationModeset totrue | adaptationModeset tofalse |
| --- | --- | --- |
| Apple Messages for Business | Message headerImageImage caption | Message headerImageImage caption |
| Instagram Direct | Message headerImageImage caption | Message headerImageImage caption |
| LINE | Message headerImage captionURL of the image | Error: Image not supported, but adaptable |
| Messenger | Message headerImageImage caption | Message headerImageImage caption |
| MMS | Message headerImageImage caption | Message headerImageImage caption |
| RCS | Message headerImageImage caption | Message headerImageImage caption |
| SMS | Message headerImage captionURL of the image | Error: Image not supported, but adaptable |
| Viber Bots | Message headerImageImage caption | Error: Message header not supported, but adaptable |
| Viber Business Messages | Message headerImageImage caption | Error: Message header not supported, but adaptable |
| WhatsApp | Message headerImageImage caption | Error: Message header not supported, but adaptable |

### Document [#document-adaptationmode]

| Messaging channel | adaptationModeset totrue | adaptationModeset tofalse |
| --- | --- | --- |
| Apple Messages for Business | DocumentDocument caption | Error: Document filename not supported |
| Instagram Direct | Document captionURL of the document | Error: Document not supported, but adaptable |
| LINE | Document captionURL of the document | Error: Document not supported, but adaptable |
| Messenger | Document | Error: Document caption not supportedError: Document filename not supported |
| MMS | DocumentDocument caption | Error: Document filename not supported |
| RCS | Document | Error: Document caption not supportedError: Document filename not supported |
| SMS | Document captionURL of the document | Error: Document not supported, but adaptable |
| Viber Bots | Document (with filename) | Error: Document caption not supported |
| Viber Business Messages | Document (with filename) | Error: Document caption not supported |
| WhatsApp | Document (with filename)Document caption | Document (with filename)Document caption |

### Video [#video-adaptationmode]

| Messaging channel | adaptationModeset totrue | adaptationModeset tofalse |
| --- | --- | --- |
| Apple Messages for Business | VideoVideo caption | Error: Image preview not supported |
| Instagram Direct | Video captionURL of the video | Error: Video not supported, but adaptable |
| LINE | Video captionURL of the video | Error: Video not supported, but adaptable |
| Messenger | Video | Error: Video caption not supportedError: Image preview not supported |
| MMS | VideoVideo caption | Error: Image preview not supported |
| RCS | Video (with image preview)Video caption | Video (with image preview)Video caption |
| SMS | Video captionURL of the video | Error: Video not supported, but adaptable |
| Viber Bots | Video (with image preview)Video caption | Video (with image preview)Video caption |
| Viber Business Messages | Video (with image preview)Video caption | Video (with image preview)Video caption |
| WhatsApp | VideoVideo caption | Error: Image preview not supported |

### Templates [#templates-adaptationmode]

| Messaging channel | adaptationModeset totrue | adaptationModeset tofalse |
| --- | --- | --- |
| Apple Messages for Business | Template | Template |
| Instagram Direct | Not supported | Not supported |
| LINE | Not supported | Not supported |
| Messenger | Not supported | Not supported |
| MMS | Not supported | Not supported |
| RCS | Template | Template |
| SMS | Not supported | Not supported |
| Viber Bots | Not supported | Not supported |
| Viber Business Messages | Not supported | Not supported |
| WhatsApp | Template | Template |

## Failover

User failover to always deliver your messages. This option provides messages delivery on other channels in case first option was unsuccessful.

You can:

- **Automate channel switching**: Messages API automatically changes channel in the event of a failed messages delivery.
- **Configure validity period**: Define period from 10 seconds to 48 hours for each channel. After validity period is expired, channel is switched and validity period for new channel starts.
- **Customize failover flow**: Define and prioritize channel failover order.

## Message status reports

Use the webhooks option to set the URL where you want to receive **message status reports**. Define the URL under the `webhooks.delivery.url` parameter for **delivery reports** or `webhooks.seen.url parameter` for **seen reports** in the API request. Note that seen reports are not supported by all channels.

```json showLineNumbers copy filename="json"

{
  "messages": [
    {
      "channel": "WHATSAPP",
      "sender": "441234567890",
      "destinations": [
        {
          "to": "440987654321"
        }
      ],
      "content": {
        "body": {
          "text": "Thank you for your registration!",
          "type": "TEXT"
        }
      },
      "webhooks": {
        "delivery": {
          "url": "https://notifyme.delivery"
        },
		"seen": {
          "url": "https://notifyme.seen"
        }
      }
    }
  ]
}
```

### Fetch delivery reports using API [#fetch-delivery-reports-message-status-reports]

You can also retrieve delivery reports on demand using a dedicated `GET` request in addition to configuring webhook URLs. This allows you to pull report information actively when needed.

Use the `GET` `/messages-api/1/reports` <apidocslink href="platform/messages-api/messages-api-status-reports/get-messages-api-delivery-reports">endpoint</apidocslink> of the **Messages API** to fetch delivery reports. You can filter the results using the following parameters:

- `channel`
- `messageID`
- `entityID`
- `applicationID`
- `campaignReferenceID`
- `bulkID`

## Tracking messages with `callbackData`

The `callbackData` parameter can store additional data used for identifying, managing, or monitoring a message. It increases the versatility of Messages API by allowing you to attach and track custom data to messages that then reflects in the Seen and Delivery reports.

The parameter can be associated with both outbound and an incoming messages:
- **Outbound (MT) message**: If `callbackData` is specified when sending a message, this value will be attached to the message.
- **Incoming (MO) message**: If `callbackData` is defined in the setup for handling incoming messages, this value will be used.

## Campaign reference ID

The campaign reference ID is a user-defined identifier that you can assign to each communication campaign within each API call at the message level. It allows you to gain enhanced campaign management capabilities, improved data insights, and streamlined processes for optimizing campaign performance:
- **Tracking and management**: Efficiently track and manage the performance of your communication campaigns. You can gain detailed insights into various success metrics by assigning a unique ID to each campaign.
- **Aggregated overview**: Compile and view aggregated data on your performance across different channels.
- **Metrics API integration**: Campaign Reference ID is integrated into our [Metrics API](https://www.infobip.com/docs/metrics-api/metrics-and-filters/#filters). This integration provides you access to detailed delivery reports and simplifies the analysis of campaign performance metrics.

## URL tracking and shortening

This feature enables you to shorten the URLs and monitor click activity to assess engagement and message effectiveness:
- **Shorten URLs**: Use the `shortenUrl` option to create short, clean URLs.
- **Track clicks**: Utilize the `trackClicks` option to monitor click activity on sent URLs.
- **Custom tracking URL**: Specify a custom `trackingUrl` for enhanced tracking.
- **Protocol removal**: Remove the protocol from URLs with the `removeProtocol` option.
- **Custom domain**: Use the `customDomain` option for branded shortened URLs.

To find out more on how to use the URL tracking and shortening feature, go to our API documentation on <apidocslink href="platform/messages-api/sending-message/send-messages-api-message">sending a Messages API message</apidocslink>.

## Scheduling

The scheduling feature in Messages API allows you to schedule and automate the sending of messages within a channel. This feature allows you to specify the content, timing and target channels, providing a convenient and effective way to manage communications. You can, for example, schedule a promotional message to be sent at optimal times for maximum engagement.

**Scheduling scenarios**:
- **Single channel message**: Scheduling triggers the message sending.
- **Failover**: Scheduling initiates the message from the first listed channel, with subsequent failover scenarios following the set failover and validity logic.