The method for sending a media template message is “SendMediaMessage”. There are two approaches to sending a media template notification on WhatsApp:
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 |
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?
Content-Type | application/x-www-form-urlencoded |
---|
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 |
Below is a sample GET request when sending an image in media template on WhatsApp.
https://app.askeva.in/api/rest/send_message?method=SendMediaMessage&format=json&v=1.1&auth_scheme=plain&msg_type=IMAGE&send_to=91xxxxxxxxxx&media_url=https://app.askeva.in/uploads/files/9rc1na231am8105f0f9962d7bxxxxxxxxxxxxxxx.jpg&caption=SayHiToAskeva.&Authorization=9rc1na231am8105007nidk6025anxxxxxxxxxxxxxxxxxxx
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
https://app.askeva.in/api/rest/send_message?method=SendMediaMessage&format=json&v=1.1&auth_scheme=plain&msg_type=DOCUMENT&send_to=91xxxxxxxxxx&media_url=https://app.askeva.in/uploads/files/5902401b6c1na231am8105f0f9962d7bxxxxxxxxxxxxxxx.pdf&caption=Have a glance at the Document to know more about Askeva.&Authorization=9rc1na231am8105007nidk6025anxxxxxxxxxxxxxxxxxxx&filename=AskEva
Video Below is a sample GET request when sending a video in media template on WhatsApp.
https://app.askeva.in/api/rest/send_message?method=SendMediaMessage&format=json&v=1.1&auth_scheme=plain&msg_type=VIDEO&send_to=91xxxxxxxxxx&media_url=https://app.askeva.in/uploads/files/15e2b49d01b6c1na231am8105f0f9962d7bxxxxxxxxxxxxxxx.mp4&caption=Askeva believes that Customer Satisfaction Is The absolute Key To Success.&Authorization=9rc1na231am8105007nidk6025anxxxxxxxxxxxxxxxxxxx
Image with Footer: Below is a sample GET request when sending an image Footer on WhatsApp.
https://app.askeva.in/api/rest/send_message?format=json&v=1.1&auth_scheme=plain&Authorization=9rc1na231am8105007nidk6025anxxxxxxxxxxxxxxxxxxx&method=SendMediaMessage&msg_type=IMAGE&media_url=https://app.askeva.in/uploads/files/f35e601f0f9962d7b34952a65b8969b2.jpg&send_to=91xxxxxxxxxx&caption=Hi sathya. “Your birthday is the first day of another 365-day journey. Be the shining thread in the beautiful tapestry of the world to make this year the best ever. Enjoy the ride.”&footer=Ask Eva&isTemplate=true
Image with CTA Buttons (Static) Below is a sample GET request when sending an image in Interactive CTA Button template on WhatsApp.
https://app.askeva.in/api/rest/send_message?method=SendMediaMessage&format=json&v=1.1&auth_scheme=plain&isTemplate=true&msg_type=IMAGE&send_to=91xxxxxxxxxx&media_url=https://app.askeva.in/uploads/files/f35e601f0f9962d7b34952a65b8969b2.jpg&caption=SayHiToAskeva.&Authorization=9rc1na231am8105007nidk6025anxxxxxxxxxxxxxxxxxxx
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.
https://app.askeva.in/api/rest/send_message?method=SendMediaMessage&format=json&v=1.1&auth_scheme=plain&isTemplate=true&msg_type=IMAGE&send_to=91xxxxxxxxxx&media_url=https://app.askeva.in/uploads/files/f35e601f0f9962d7b34952a65b8969b2.jpg&caption=SayHiToAskeva.&Authorization=9rc1na231am8105007nidk6025anxxxxxxxxxxxxxxxxxxx
Below is a sample GET request when sending a text message with CTA Buttons on WhatsApp.
https://app.askeva.in/api/rest/send_message?method=SendMessage&format=json&v=1.1&auth_scheme=plain&isTemplate=true&msg_type=Text&msg=Askeva%20is%20our%20Whatsapp%20based%20Chatbot%20that%20can%20automate%20all%20kinds%20of%20business%20processes%20for%20a%20business%20in%20the%20World%20biggest%20platform%20Whatsapp.&Authorization=9rc1na231am8105007nidk6025anxxxxxxxxxxxxxxxxxxx&send_to=91xxxxxxxxxx
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.
Below is a sample GET request when sending a text message with CTA Buttons on WhatsApp.
https://app.askeva.in/api/rest/send_message?method=SendMessage&format=json&v=1.1&auth_scheme=plain&isTemplate=true&msg_type=Text&msg=Askeva%20is%20our%20Whatsapp%20based%20Chatbot%20that%20can%20automate%20all%20kinds%20of%20business%20processes%20for%20a%20business%20in%20the%20World%20biggest%20platform%20Whatsapp.&Authorization=9rc1na231am8105007nidk6025anxxxxxxxxxxxxxxxxxxx&send_to=91xxxxxxxxxx
Below is a sample GET request when sending a text message with Quick Reply Buttons on WhatsApp.
https://app.askeva.in/api/rest/send_message?method=SendMessage&format=json&v=1.1&auth_scheme=plain&isTemplate=true&msg_type=Text&msg=Uplift your Customer Experience today with AskEva.&Authorization=9rc1na231am8105007nidk6025anxxxxxxxxxxxxxxxxxxx&send_to=91xxxxxxxxxx
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.