Send a Document
const message = await zavu.messages.send({
to: "+14155551234",
channel: "whatsapp",
messageType: "document",
content: {
mediaUrl: "https://example.com/invoice.pdf",
filename: "Invoice-12345.pdf"
}
});
message = zavu.messages.send(
to="+14155551234",
channel="whatsapp",
message_type="document",
content={
"media_url": "https://example.com/invoice.pdf",
"filename": "Invoice-12345.pdf"
}
)
message = client.messages.send(
to: "+14155551234",
channel: "whatsapp",
message_type: "document",
content: {
media_url: "https://example.com/invoice.pdf",
filename: "Invoice-12345.pdf"
}
)
message, err := client.Messages.Send(context.TODO(), zavudev.MessageSendParams{
To: zavudev.String("+14155551234"),
Channel: zavudev.String("whatsapp"),
MessageType: zavudev.String("document"),
Content: &zavudev.MessageContentParams{
MediaURL: zavudev.String("https://example.com/invoice.pdf"),
Filename: zavudev.String("Invoice-12345.pdf"),
},
})
$message = $client->messages->send([
'to' => '+14155551234',
'channel' => 'whatsapp',
'messageType' => 'document',
'content' => [
'mediaUrl' => 'https://example.com/invoice.pdf',
'filename' => 'Invoice-12345.pdf',
],
]);
curl -X POST https://api.zavu.dev/v1/messages \
-H "Authorization: Bearer zv_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"to": "+14155551234",
"channel": "whatsapp",
"messageType": "document",
"content": {
"mediaUrl": "https://example.com/invoice.pdf",
"filename": "Invoice-12345.pdf"
}
}'
Document with Caption
const message = await zavu.messages.send({
to: "+14155551234",
channel: "whatsapp",
messageType: "document",
text: "Your invoice for January 2024",
content: {
mediaUrl: "https://example.com/invoice.pdf",
filename: "Invoice-12345.pdf"
}
});
message = zavu.messages.send(
to="+14155551234",
channel="whatsapp",
message_type="document",
text="Your invoice for January 2024",
content={
"media_url": "https://example.com/invoice.pdf",
"filename": "Invoice-12345.pdf"
}
)
message = client.messages.send(
to: "+14155551234",
channel: "whatsapp",
message_type: "document",
text: "Your invoice for January 2024",
content: {
media_url: "https://example.com/invoice.pdf",
filename: "Invoice-12345.pdf"
}
)
message, err := client.Messages.Send(context.TODO(), zavudev.MessageSendParams{
To: zavudev.String("+14155551234"),
Channel: zavudev.String("whatsapp"),
MessageType: zavudev.String("document"),
Text: zavudev.String("Your invoice for January 2024"),
Content: &zavudev.MessageContentParams{
MediaURL: zavudev.String("https://example.com/invoice.pdf"),
Filename: zavudev.String("Invoice-12345.pdf"),
},
})
$message = $client->messages->send([
'to' => '+14155551234',
'channel' => 'whatsapp',
'messageType' => 'document',
'text' => 'Your invoice for January 2024',
'content' => [
'mediaUrl' => 'https://example.com/invoice.pdf',
'filename' => 'Invoice-12345.pdf',
],
]);
curl -X POST https://api.zavu.dev/v1/messages \
-H "Authorization: Bearer zv_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"to": "+14155551234",
"channel": "whatsapp",
"messageType": "document",
"text": "Your invoice for January 2024",
"content": {
"mediaUrl": "https://example.com/invoice.pdf",
"filename": "Invoice-12345.pdf"
}
}'
Specifications
| Property | Requirement |
|---|---|
| Formats | PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, TXT |
| Max size | 100 MB |
| Filename | Optional but recommended |
| Caption | Optional, max 1024 chars |
Always provide a descriptive
filename so users know what they’re downloading.URL Requirements
Your document URL must:- Be publicly accessible (no authentication)
- Use HTTPS
- Return the correct
Content-Typeheader - Be available for at least 24 hours
Use Cases
- Invoices and receipts
- Contracts and agreements
- Reports and presentations
- User manuals
- Shipping labels
