WhatsApp API'nizi kullanmaya başlayın
https://conwp.com/yonetim/api/index.php
Tüm API istekleri için API Key gereklidir. API Key'i header veya query parameter olarak gönderebilirsiniz:
X-API-Key: your_api_key_here
?api_key=your_api_key_here
POST /yonetim/api/index.php?endpoint=send-message
{
"receiver": "905551234567",
"data": {
"message": "Merhaba! Bu bir test mesajıdır.",
"message_type": "text",
"media_url": "https://example.com/image.jpg"
}
}
{
"success": true,
"message_id": 123,
"status": "sent"
}
curl -X POST "https://conwp.com/yonetim/api/index.php?endpoint=send-message" \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"receiver": "905551234567",
"data": {
"message": "Merhaba! Bu bir test mesajıdır."
}
}'
POST /yonetim/api/index.php?endpoint=send-bulk-message
{
"messages": [
{
"receiver": "905551234567",
"data": {
"message": "Merhaba Ahmet!"
}
},
{
"receiver": "905559876543",
"data": {
"message": "Merhaba Ayşe!"
}
}
]
}
{
"success": true,
"message_ids": [123, 124],
"total_queued": 2,
"sent": 2,
"failed": 0
}
GET /yonetim/api/index.php?endpoint=devices
{
"success": true,
"devices": [
{
"token": "device_token_123",
"device_name": "Ana Cihaz",
"status": "active",
"wa_number": "905551234567",
"wa_name": "John Doe",
"wa_platform": "android",
"wa_is_business": false,
"last_seen": "2024-01-15 10:30:00"
}
]
}
GET /yonetim/api/index.php?endpoint=status
{
"success": true,
"user": {
"username": "john_doe",
"api_key_name": "Production API Key"
},
"usage": {
"message_used": 150,
"device_used": 2,
"member_used": 5,
"storage_used": 1024
},
"api_stats": {
"total_requests": 1000,
"successful_requests": 950,
"failed_requests": 50,
"avg_execution_time": 0.125
}
}
HTTP Kodu | Açıklama |
---|---|
200 |
Başarılı |
400 |
Geçersiz istek |
401 |
Kimlik doğrulama hatası |
403 |
Yetkisiz erişim |
404 |
Endpoint bulunamadı |
405 |
Geçersiz HTTP metodu |
429 |
Rate limit aşıldı |
500 |
Sunucu hatası |
API istekleri saatlik limit ile sınırlandırılmıştır. Varsayılan limit 1000 istek/saattir.
$body = array(
"receiver" => "905330001122",
"data" => array("message" => "Merhaba, nasılsın")
);
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://conwp.com/yonetim/api/index.php?endpoint=send-message",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($body),
CURLOPT_HTTPHEADER => [
"Accept: */*",
"Content-Type: application/json",
"X-API-Key: your_api_key_here"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const apiKey = 'your_api_key_here';
const url = 'https://conwp.com/yonetim/api/index.php?endpoint=send-message';
const data = {
receiver: '905551234567',
data: {
message: 'Merhaba!'
}
};
fetch(url, {
method: 'POST',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));