Send a Media Template Notification

The method for sending a media template message is “SendMediaMessage”. There are two approaches to sending a media template notification on WhatsApp:

  • Pass the public media URL as an API parameter using SendMediaMessage API
  • First use the UploadMedia API to upload the media file. This API returns a media_id, which canthen be passed as an API parameter in SendMediaMessage API. This is a 2-step process.
Media Type Max Media Upload Size Post-processing Media Size
Image 100 MB 5 MB
Document 100 Mb 100 MB
video 100 MB 16 MB

Using Media Url

API Endpoint

To send a media message on WhatsApp using a media_url as a parameter, the API request is made to this endpoint: https://app.askeva.in/api/rest/send_message?

Request Headers

Content-Type application/x-www-form-urlencoded

Request Body

Key Description Example
method REQUIRED | string The API method to perform a specific action i.e. send a message on WhatsApp Must be: SendMessage Send Message
auth_scheme REQUIRED | string The authentication scheme of the API. Must be: plain plain
v REQUIRED | string The API version. Must be: 1.1 1.1
send_to REQUIRED | string The phone number of the recipient to whom message is being sent. Number must be in E.164 format 919892123456
msg REQUIRED | string The type of message to be sent to the customer. Must be one of: IMAGE, DOCUMENT, VIDEO IMAGE
media_url REQUIRED | string The Public URL where the media attachment file is hosted. https://image.shutterstock.c om/image- illustration/movie-ticket- icon-260nw-663331288.jpg
Filenam OPTIONAL | string This is an optional filename that can be passed in case of msg_type=DOCUMENT. ASKEVA
header OPTIONAL | string In a Text message, a header usually refers to the ©Title© of the message. 60 alphanumeric characters (with variable values) are allowed for this parameter. SUPER100SEGMENT
footer OPTIONAL | string A short line of text to the bottom of the message template "Get yourself web-checked- in, to avoid queues"
caption OPTIONAL | string The caption text to be sent along with the media attachment. This must exactly match the media template that is pre-approved by WhatsApp. This can be a maximum of 1024 characters as per WhatsApp media template specifications Your ticket is confirmed for 20-DEC-2019.
format OPTIONAL | string The API response message format. Default value is text, unless otherwise specified. Must be one of: text, json json

Sample Image Request

Below is a sample GET request when sending an image in media template on WhatsApp.

Below is a sample GET request when sending an image in media template on WhatsApp.

Document Below is a sample GET request when sending a document / file in media template on WhatsApp

Video Below is a sample GET request when sending a video in media template on WhatsApp.

Image with Footer: Below is a sample GET request when sending an image Footer on WhatsApp.

Image with CTA Buttons (Static) Below is a sample GET request when sending an image in Interactive CTA Button template on WhatsApp.

Here, since the Button Template has static Call-to-Action buttons, it is exactly similar to sending a simple Media Template message except for isTemplate=true parameter. This will ensure that the Call-to-Action button template is sent on WhatsApp as expected.

Document with CTA Buttons (Dynamic) Below is a sample GET request when sending a document / file in Interactive CTA Button template on WhatsApp.

Text with CTA Buttons

Simple request with static Button URL

Below is a sample GET request when sending a text message with CTA Buttons on WhatsApp.

Here, since the Button Template has static Call-to-Action buttons, it is exactly similar to sending a simple text message except for isTemplate=true parameter. This will ensure that the Call-to-Action button template is sent on WhatsApp as expected.

Simple request with Dynamic Button URL

Below is a sample GET request when sending a text message with CTA Buttons on WhatsApp.

Please Note
  • lYou must use the key generated for your enterprise account to encrypt API parameter values when sending the API request. Once the request is received by AskEVA. AskEVA sent ahead to WhatsApp.
  • Please read Appendix A for detailed steps and code samples on how to encrypt the payload before sending an API request.

Text with Quick Reply Buttons

Simple requestQuick Reply Button

Below is a sample GET request when sending a text message with Quick Reply Buttons on WhatsApp.

Here, since the Button Template has static Quick Reply buttons, it is exactly similar to sending a simple text message except for isTemplate=true parameter. This will ensure that the Quick Reply button template is sent on WhatsApp as expected.