Imagine you need to send images, videos, or documents to your customers via WhatsApp, but manually sending each file is exhausting. That’s where Wassenger API comes in! Let me show you how I automated sending multimedia messages to WhatsApp numbers. 📱✨
1. Why Use Wassenger API for Multimedia Messaging? 🤔
Wassenger API allows you to send various media types like images, videos, and PDFs directly to individual WhatsApp numbers. No more manual uploads or endless typing. Just code it once, and let Wassenger handle the rest! 🛠️
🔗 Ready to simplify your WhatsApp messaging? 🚀 Sign up for Wassenger and start sending multimedia messages effortlessly!
2. Setting Up Your API Key 🔑
- Step 1: Get your API key
- Step 2: Use languages like Node.js, Python, PHP, C#, Java, Go, or Powershell
3. Prepare your request
API URL
Use the POST method with the URL:
https://api.wassenger.com/v1/messages
Headers
Content-Type: application/json
Token: YOUR_API_KEY
🤩 🤖 Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!
4. JSON Payload Examples for Multimedia Messages 🤖
Send an Image
{
"phone": "+1234567890",
"message": "Check out this image!",
"media": { "url": "https://picsum.photos/600/400", "expiration": "7d" }
}
Send a Video
{
"phone": "+1234567890",
"message": "Watch this video!",
"media": { "url": "https://download.samplelib.com/mp4/sample-5s.mp4" }
}
Send a PDF Document
{
"phone": "+1234567890",
"media": { "url": "https://www.africau.edu/images/default/sample.pdf" }
}
5. Code Snippets in Multiple Languages 💻
Node.js, Python, PHP, Java, C# (RestClient & HttpClient), Go, and Powershell code examples here for sending multimedia messages.
Node.js (Axios)
const axios = require('axios');
axios.post('https://api.wassenger.com/v1/messages', {
phone: '+1234567890',
message: 'Here is an image!',
media: { url: 'https://picsum.photos/600/400' }
}, { headers: { 'Token': 'YOUR_API_KEY' }});
Python (Requests)
import requests
requests.post('https://api.wassenger.com/v1/messages',
json={"phone": "+1234567890", "media": {"url": "https://picsum.photos/600/400"}},
headers={'Token': 'YOUR_API_KEY'})
🤩 🤖 Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!
PHP (cURL)
$ch = curl_init('https://api.wassenger.com/v1/messages');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Token: YOUR_API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["phone" => "+1234567890", "media" => ["url" => "https://picsum.photos/600/400"]]));
curl_exec($ch);
curl_close($ch);
Java (HttpURLConnection)
HttpURLConnection conn =(HttpURLConnection) new URL("https://api.wassenger.com/v1/messages").openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Token", "YOUR_API_KEY");
conn.setDoOutput(true);
String jsonInput = "{\"phone\":\"+1234567890\", \"media\":{\"url\":\"https://picsum.photos/600/400\"}}";
try(OutputStream os = conn.getOutputStream()) { os.write(jsonInput.getBytes()); os.flush(); }
C# (RestClient)
var client = new RestClient("https://api.wassenger.com/v1/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("Token", "YOUR_API_KEY");
request.AddJsonBody(new { phone = "+1234567890", media = new { url = "https://picsum.photos/600/400" } });
IRestResponse response = client.Execute(request);
C# (HttpClient)
HttpClient client = new HttpClient();
var content = new StringContent("{ \"phone\": \"+1234567890\", \"media\": {\"url\": \"https://picsum.photos/600/400\"}}", Encoding.UTF8, "application/json");
client.DefaultRequestHeaders.Add("Token", "YOUR_API_KEY");
var response = await client.PostAsync("https://api.wassenger.com/v1/messages", content);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Powershell
$headers = @{ 'Token' = 'YOUR_API_KEY'; 'Content-Type' = 'application/json' }
$body = @{ phone = '+1234567890'; media = @{ url = 'https://picsum.photos/600/400' } } | ConvertTo-Json
Invoke-RestMethod -Uri 'https://api.wassenger.com/v1/messages' -Method Post -Headers $headers -Body $body
Live API testing
You can live-test and play with the API directly from your browser.
Once you are done testing, get the auto-generated code example in your preferred programming language and you will be ready to go.
Test our LIVE API tester now 🚀
📢 Don’t miss out! Automate your WhatsApp media messages now with Wassenger. 🚀







