Bahasa Indonesia
Kirim Status
POST/statusBikin status WhatsApp langsung dari kode kamu. Cocok buat promo harian, pengumuman, atau sekadar pamer hasil deploy. Tipe yang didukung cuma tiga: teks, gambar, dan video.
Detail Endpoint
- Base URL:
https://api-zawa.azickri.com - Header:
id,session-id, danContent-Type: application/json - Syarat: sesi harus lagi nyambung (
isConnected: true)
Header
| Header | Tipe | Wajib | Keterangan |
|---|---|---|---|
id | string | Ya | id dari Buat Session. |
session-id | string | Ya | sessionId dari Buat Session. |
Request Body
| Kolom | Tipe | Wajib | Keterangan |
|---|---|---|---|
type | string | Ya | Tipe status: text, image, atau video. |
text | string | Untuk text | Isi status. Di tipe image dan video, kolom ini jadi caption (opsional). |
image | object | Untuk image | url dan mimetype wajib, thumbnail opsional. Sama kayak di Kirim Pesan. |
video | object | Untuk video | url, mimetype, dan duration wajib, thumbnail opsional. Sama kayak di Kirim Pesan. |
Beberapa hal yang Zawa lakuin otomatis:
- Status teks pakai latar warna hijau tua.
- Gambar dikompres dulu biar pas buat status.
- Kalau video nggak dikasih
thumbnail, thumbnail-nya diambil otomatis dari videonya.
Siapa yang Bisa Lihat?
Penerima status ngikutin privasi status di HP kamu (WhatsApp → Pembaruan → ⋮ → Privasi status):
| Privasi status | Penerima |
|---|---|
| Kontak saya | Semua kontak di buku kontak yang tersinkron. |
| Kontak saya, kecuali... | Semua kontak yang tersinkron, kecuali yang dikecualikan. |
| Hanya bagikan dengan... | Cuma kontak yang ada di daftar itu. |
Dua opsi pertama butuh buku kontak HP kamu udah tersinkron ke Zawa. Biasanya ini otomatis jalan setelah scan QR. Kalau kamu dapet error contacts not synced, reset sesi terus scan ulang, atau pindah ke opsi Hanya bagikan dengan....
Aturan WhatsApp tetap berlaku
Status cuma kelihatan buat orang yang juga nyimpen nomor kamu di kontaknya.
Contoh Request
bash
curl -X POST "https://api-zawa.azickri.com/status" \
-H "id: YOUR_ID" \
-H "session-id: YOUR_SESSION_ID" \
-H "Content-Type: application/json" \
-d '{"type":"text","text":"Deploy hari ini lancar jaya 🚀"}'javascript
import axios from 'axios';
const response = await axios.post(
'https://api-zawa.azickri.com/status',
{
type: 'text',
text: 'Deploy hari ini lancar jaya 🚀',
},
{
headers: {
'id': 'YOUR_ID',
'session-id': 'YOUR_SESSION_ID',
},
},
);
console.log(response.data);javascript
const response = await fetch('https://api-zawa.azickri.com/status', {
method: 'POST',
headers: {
'id': 'YOUR_ID',
'session-id': 'YOUR_SESSION_ID',
'Content-Type': 'application/json',
},
body: JSON.stringify({
type: 'text',
text: 'Deploy hari ini lancar jaya 🚀',
}),
});
const data = await response.json();
console.log(data);Contoh Body per Tipe
json
{
"type": "text",
"text": "Deploy hari ini lancar jaya 🚀"
}json
{
"type": "image",
"text": "Menu spesial hari ini",
"image": {
"url": "https://example.com/image.jpg",
"mimetype": "image/jpeg"
}
}json
{
"type": "video",
"text": "Behind the scenes",
"video": {
"url": "https://example.com/video.mp4",
"mimetype": "video/mp4",
"duration": 15
}
}Response
json
{
"statusId": "3EB0C4A8F1D2B3E4A5F6"
}json
// Kolom wajib buat tipe itu kosong
{
"statusCode": 400,
"message": "text should not be empty"
}
// Header kurang
{
"statusCode": 400,
"message": "invalid header"
}json
{
"statusCode": 404,
"message": "session not found"
}json
// Buku kontak belum tersinkron
{
"statusCode": 500,
"message": "contacts not synced, reconnect the session or set status privacy to \"only share with\""
}
// Privasi "Hanya bagikan dengan..." tapi daftarnya kosong
{
"statusCode": 500,
"message": "status privacy \"only share with\" has no contacts"
}| Kolom | Tipe | Keterangan |
|---|---|---|
statusId | string | ID status dari WhatsApp. |