# 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](https://guides.clickatell.com/whatsapp-channel/channel-capabilities/whatsapp-message-templates/send-message-templates)

## **Select media type**

1. When [creating your template](https://guides.clickatell.com/whatsapp-channel/channel-capabilities/whatsapp-message-templates/add-message-templates) 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* ](https://guides.clickatell.com/whatsapp-channel/channel-capabilities/whatsapp-message-templates/use-location-in-message-templates)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="https://content.gitbook.com/content/H9mbp0ZlSZKdmkQMXA0U/blobs/JX0QFnc24LDt44OA5qcV/image.png" 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.
