# Use media in message templates

To use media in your message template, you must:

1. [Select the media type](#select-media-type)
2. [Upload the media file](#upload-media)
3. [Send the message template via One API](/whatsapp-channel/channel-capabilities/whatsapp-message-templates/send-message-templates.md)

## **Select media type**

1. When [creating your template](/whatsapp-channel/channel-capabilities/whatsapp-message-templates/add-message-templates.md) in Facebook Business Manager, you can select to add "Media" as the header. &#x20;
2. Select the type of media you want to add to your template.&#x20;
   * Note: The [*Location* ](/whatsapp-channel/channel-capabilities/whatsapp-message-templates/use-location-in-message-templates.md)media type is only available on Cloud.
3. Add a sample for the header content.

{% hint style="info" %}
All variables (e.g., {{1}}) are set when [sending the message via One API](https://docs.clickatell.com/channels/one-api/one-api-reference/#operation/sendMessageREST_1), where you can specify the parameters in the payload.&#x20;
{% endhint %}

<figure><img src="/files/QY0iPwfl6foVH17Tagbp" alt=""><figcaption></figcaption></figure>

## **Upload media**

{% hint style="warning" %}
You can only send the template after uploading the media file.
{% endhint %}

1. Once your template is approved, upload the media file to be included in your message template onto the Clickatell server by using the [*Upload media file*](https://docs.clickatell.com/channels/one-api/one-api-reference/#operation/uploadFile) and [*Get media file metadata*](https://docs.clickatell.com/channels/one-api/one-api-reference/#operation/getMetadata) endpoints as described in the [One API Reference](https://docs.clickatell.com/channels/one-api/one-api-reference/) document.
2. The successful upload of your media will return a ***fileID*** which is the unique reference to the media file you’ve uploaded. You'll use this in the next step.

{% hint style="info" %}
Although the template is not limited to a single media file, it is registered for a **specific media type** only.
{% endhint %}

## **Send message template via One API**

1. Once you have successfully uploaded your media file, you can send the message template to customers via our One API using the [Sends one or more messages endpoint](https://docs.clickatell.com/channels/one-api/one-api-reference/#operation/sendMessageREST_1) as described in the [One API Reference](https://docs.clickatell.com/channels/one-api/one-api-reference/) document.
2. As part of the One API call, you need to include the template name and the *fileID* as returned in the step above.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guides.clickatell.com/whatsapp-channel/channel-capabilities/whatsapp-message-templates/use-media-in-message-templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
