Send an Image
const result = await zavu.messages.send({
to: "+14155551234",
channel: "whatsapp",
messageType: "image",
content: {
mediaUrl: "https://example.com/product.jpg",
},
});
result = zavu.messages.send(
to="+14155551234",
channel="whatsapp",
message_type="image",
content={
"media_url": "https://example.com/product.jpg"
}
)
result = client.messages.send_(
to: "+14155551234",
channel: "whatsapp",
message_type: "image",
content: {
media_url: "https://example.com/product.jpg"
}
)
result, err := client.Messages.Send(context.TODO(), zavudev.MessageSendParams{
To: zavudev.String("+14155551234"),
Channel: zavudev.String("whatsapp"),
MessageType: zavudev.String("image"),
Content: &zavudev.MessageContentParams{
MediaURL: zavudev.String("https://example.com/product.jpg"),
},
})
$result = $client->messages->send([
'to' => '+14155551234',
'channel' => 'whatsapp',
'messageType' => 'image',
'content' => [
'mediaUrl' => 'https://example.com/product.jpg',
],
]);
curl -X POST https://api.zavu.dev/v1/messages \
-H "Authorization: Bearer $ZAVUDEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+14155551234",
"channel": "whatsapp",
"messageType": "image",
"content": {
"mediaUrl": "https://example.com/product.jpg"
}
}'
Image with Caption
const result = await zavu.messages.send({
to: "+14155551234",
channel: "whatsapp",
messageType: "image",
text: "Check out our new product!",
content: {
mediaUrl: "https://example.com/product.jpg",
},
});
result = zavu.messages.send(
to="+14155551234",
channel="whatsapp",
message_type="image",
text="Check out our new product!",
content={
"media_url": "https://example.com/product.jpg"
}
)
result = client.messages.send_(
to: "+14155551234",
channel: "whatsapp",
message_type: "image",
text: "Check out our new product!",
content: {
media_url: "https://example.com/product.jpg"
}
)
result, err := client.Messages.Send(context.TODO(), zavudev.MessageSendParams{
To: zavudev.String("+14155551234"),
Channel: zavudev.String("whatsapp"),
MessageType: zavudev.String("image"),
Text: zavudev.String("Check out our new product!"),
Content: &zavudev.MessageContentParams{
MediaURL: zavudev.String("https://example.com/product.jpg"),
},
})
$result = $client->messages->send([
'to' => '+14155551234',
'channel' => 'whatsapp',
'messageType' => 'image',
'text' => 'Check out our new product!',
'content' => [
'mediaUrl' => 'https://example.com/product.jpg',
],
]);
curl -X POST https://api.zavu.dev/v1/messages \
-H "Authorization: Bearer $ZAVUDEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+14155551234",
"channel": "whatsapp",
"messageType": "image",
"text": "Check out our new product!",
"content": {
"mediaUrl": "https://example.com/product.jpg"
}
}'
Specifications
| Property | Requirement |
|---|---|
| Formats | JPEG, PNG |
| Max size | 5 MB |
| Caption | Optional, max 1024 chars |
URL Requirements
Your image URL must:- Be publicly accessible (no authentication)
- Use HTTPS
- Return the correct
Content-Typeheader - Be available for at least 24 hours
Private or expiring URLs will cause delivery failures. Use a CDN or cloud storage for reliable hosting.
Use Cases
- Product photos
- Order receipts
- QR codes
- Promotional banners
- Visual instructions
