Send WhatsApp Media Message
Base URL
https://graph.communikate.in
Authentication
All API requests require authentication credentials. Include your API Key and API Secret in request headers to access protected endpoints.
Every API endpoint requires the following headers.
X-Api-Key
Your public API key.
X-Api-Secret
Your secret API key.
POST
/meta/wa/send/media/document/template
Request Parameters
|
to *
string
|
Recipient whatsapp number with country code but without (+ sign).
|
|
mediaId *
string
|
To specify the MediaId you must upload your desired file
using File Upload endpoint
|
|
caption *
string
|
For internal purpose but this text will not be shown in WhatsApp Chatbox.
|
|
filename *
string
|
To display this text under the file in WhatsApp Chatbox.
|
|
templateName *
string
|
Meta approved template name
|
|
langCode *
string
|
The Language Code in which the template was created.
|
|
parameters (optional)
string array
|
An array of string which could substitute the variables present in the template.
|
Response
|
isSuccess
boolean
|
true: success
false: failed |
|
message
string
|
response messae from API endpoint
|
|
traceId
string?
|
a server specific tracing code by which the actual error can be reviewed
|
|
result
string?
|
if isSuccess: true then it contains WhatsApp Message Id. You should store this value in your database for checking delivery.
|
cURL Request
curl 'https://graph.communikate.in/meta/wa/send/media/document/template' \
--header 'X-Api-Key: YOUR_API_KEY' \
--header 'X-Api-Secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--payload '{
"to": "9194xxxxxx13",
"mediaId": "xxxxxxxxxxx",
"caption": "Dues Reminder For A/c 26002",
"filename": "dues_reminder_acc_26002.pdf",
"templateName": "dues_reminder_pdf_04var_eng_tver002",
"langCode": "en_US",
"parameters": [
"ANAND KUMAR SINGH",
"AADITYA KUMAR",
"STD-IX",
"12,650/-"
]
}'
Json Response
{
"isSuccess": true,
"message": "Template Message sent and logged successfully.",
"traceId": null,
"result": "wamid.xxxxxxxxxxx"
}