WhatsApp now allows uploading samples for templates with media headers : Document, Video, Image etc
To ensure templates submitted get approved seamlessly, uploading samples is a good practice.
Use this API to submit media sample files and generate media IDs.Media ID would then be used with create templates API to create and submit media templates for approval.
https://<api_key>:<api_token><subdomain>/v2/accounts/<your_sid>/templates/sample
<your_api_key>
and <your_api_token>
with the API key and token created by you.<your_sid>
with your “Account sid”<subdomain>
with the region of your account
<your_api_key>
, <your_api_token>
and <your_sid>
are available in the API settings page of your Exotel Dashboard
Listed below are the parameters for the POST API.
Parameter Name |
Type |
Mandatory/ Optional |
Value/ Description |
file_length |
String |
Mandatory |
Size of the file in bytes |
file_type |
String |
Mandatory |
Type of the file (image/jpeg etc) |
POST DATA
Binary data of the file
HTTPResponseObject
Parameter Name |
Type |
Mandatory/ Optional |
Value/ Description |
request_id |
String |
Mandatory |
ID of the request |
method |
String |
Mandatory |
HTTP Request Method |
http_code |
Integer |
Mandatory |
HTTP Code of the request |
response |
ResponseObject |
Mandatory |
Response for the request |
ResponseObject
Parameter Name |
Type |
Mandatory/ Optional |
Values/ Description |
|
ChannelResponseObject |
Optional |
Channel Response for Whatsapp |
ChannelResponseObject
Parameter Name |
Type |
Mandatory/ Optional |
Values/ Description |
file_handle |
[]FileHandleResponseObject |
Mandatory |
Message Response |
FileHandleResponseObject
Parameter Name |
Type |
Mandatory/ Optional |
Value/ Description |
id |
String |
Mandatory |
Id of the file_handle |