POST
https://api.alatwa.com/send/media
Headers
| Name | Type | | Description |
| Authorization |
string |
required |
API Key akun Alat WA Anda |
| Content-Type |
string |
required |
application/json |
Body Parameters
| Name | Type | | Description |
| device |
string |
required |
Device ID akun Alat WA |
| phone |
string |
required |
Nomor WhatsApp penerima |
| message |
string |
required |
Caption/pesan yang menyertai media |
| url |
string |
optional |
URL file media (gambar/video/dokumen) |
| media_b64 |
string |
optional |
File media dalam format Base64 (alternatif URL) |
| filename |
string |
optional |
Nama file untuk dokumen |
| schedule |
string |
optional |
Jadwal pengiriman (format: Y-m-d H:i:s) |
Code Examples
curl -X POST https://api.alatwa.com/send/media \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"device": "YOUR_DEVICE_ID",
"phone": "628111111111",
"message": "Lihat gambar ini",
"url": "https:\/\/example.com\/image.jpg"
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.alatwa.com/send/media');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
const response = await fetch('https://api.alatwa.com/send/media', {
method: 'POST',
headers: {
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"device": "YOUR_DEVICE_ID",
"phone": "628111111111",
"message": "Lihat gambar ini",
"url": "https:\/\/example.com\/image.jpg"
})
});
import requests
response = requests.post(
'https://api.alatwa.com/send/media',
headers={
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
"device": "YOUR_DEVICE_ID",
"phone": "628111111111",
"message": "Lihat gambar ini",
"url": "https:\/\/example.com\/image.jpg"
}
)
Response
200 Success
{
"status": "ok",
"message_id": "3EB07186F0298BF9E5E8",
"from": "628122222222",
"to": "628111111111",
"message": "Success"
}
Response Fields
| Field | Type | Description |
| status |
string |
"ok" atau "error" |
| message_id |
string |
Unique message ID |
| from |
string |
Nomor WA pengirim |
| to |
string |
Nomor WA penerima |
| message |
string |
Pesan status |