API Documentation
Authentication
All API requests require an API Key to be sent in the Authorization header.
Authorization: Bearer sk_your_api_key_here
Note: You can find your API Key in the Settings page under the "API Access" section.
Messaging API
Endpoints for sending various types of messages.
/v1/send/text
Send a standard text message to a specific WhatsApp number.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone | String | Yes | Number with country code (e.g., 90555...) |
| message | String | Yes | The message content. |
| device_id | Integer | No | Cihaz ID'si. Belirtilmezse, bağlı olan ilk cihazdan gönderilir. |
Code Examples
curl -X POST https://server.wbox.me/v1/send/text \
-H "Authorization: Bearer sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "905555555555",
"message": "Hello from API!"
}'
fetch('https://server.wbox.me/v1/send/text', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_YOUR_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
phone: '905555555555',
message: 'Hello from API!'
})
})
.then(res => res.json())
.then(console.log);
$.ajax({
url: 'https://server.wbox.me/v1/send/text',
method: 'POST',
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' },
contentType: 'application/json',
data: JSON.stringify({
phone: '905555555555',
message: 'Hello from API!'
}),
success: function(res) { console.log(res); }
});
const axios = require('axios');
axios.post('https://server.wbox.me/v1/send/text', {
phone: '905555555555',
message: 'Hello from API!'
}, {
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' }
}).then(res => console.log(res.data));
import requests
response = requests.post(
'https://server.wbox.me/v1/send/text',
headers={'Authorization': 'Bearer sk_YOUR_KEY'},
json={'phone': '905555555555', 'message': 'Hello from API!'}
)
print(response.json())
$ch = curl_init('https://server.wbox.me/v1/send/text');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer sk_YOUR_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'phone' => '905555555555',
'message' => 'Hello from API!'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
require 'net/http'
require 'json'
require 'uri'
uri = URI.parse("https://server.wbox.me/v1/send/text")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer sk_YOUR_KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"phone" => "905555555555",
"message" => "Hello from API!"
})
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
/v1/send/media
Send an image, video, or document using a public URL.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone | String | Yes | Number with country code (e.g., 90555...) |
| media_url | String | Yes | Direct public URL to the media file. |
| message | String | No | Medya altına eklenecek açıklama (caption). |
| device_id | Integer | No | Cihaz ID'si. Belirtilmezse ilk cihaz kullanılır. |
Code Examples
curl -X POST https://server.wbox.me/v1/send/media \
-H "Authorization: Bearer sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "905555555555",
"media_url": "https://example.com/image.jpg",
"message": "Caption here"
}'
fetch('https://server.wbox.me/v1/send/media', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_YOUR_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
phone: '905555555555',
media_url: 'https://example.com/image.jpg',
message: 'Caption here'
})
})
.then(res => res.json())
.then(console.log);
$.ajax({
url: 'https://server.wbox.me/v1/send/media',
method: 'POST',
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' },
contentType: 'application/json',
data: JSON.stringify({
phone: '905555555555',
media_url: 'https://example.com/image.jpg',
message: 'Caption here'
}),
success: function(res) { console.log(res); }
});
const axios = require('axios');
axios.post('https://server.wbox.me/v1/send/media', {
phone: '905555555555',
media_url: 'https://example.com/image.jpg',
message: 'Caption here'
}, {
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' }
}).then(res => console.log(res.data));
import requests
response = requests.post(
'https://server.wbox.me/v1/send/media',
headers={'Authorization': 'Bearer sk_YOUR_KEY'},
json={
'phone': '905555555555',
'media_url': 'https://example.com/image.jpg',
'message': 'Caption here'
}
)
print(response.json())
$ch = curl_init('https://server.wbox.me/v1/send/media');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer sk_YOUR_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'phone' => '905555555555',
'media_url' => 'https://example.com/image.jpg',
'message' => 'Caption here'
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
require 'net/http'
require 'json'
require 'uri'
uri = URI.parse("https://server.wbox.me/v1/send/media")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer sk_YOUR_KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"phone" => "905555555555",
"media_url" => "https://example.com/image.jpg",
"message" => "Caption here"
})
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
/v1/send/event
Send a styled calendar event invitation.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone | String | Yes | Number with country code (e.g., 90555...) |
| event | Object | Yes | Etkinlik detaylarını içeren JSON objesi. |
| event.title | String | Yes | Etkinlik başlığı. |
| event.description | String | No | Etkinlik detayı. |
| event.startDate | Datetime | No | ISO format veya düz metin ('2026-10-15T14:00') |
Code Examples
curl -X POST https://server.wbox.me/v1/send/event \
-H "Authorization: Bearer sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "905555555555",
"event": {
"title": "Meeting",
"description": "Weekly review",
"startDate": "2026-10-15T14:00"
}
}'
fetch('https://server.wbox.me/v1/send/event', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_YOUR_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
phone: '905555555555',
event: { title: 'Meeting', description: 'Weekly review', startDate: '2026-10-15T14:00' }
})
})
.then(res => res.json())
.then(console.log);
$.ajax({
url: 'https://server.wbox.me/v1/send/event',
method: 'POST',
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' },
contentType: 'application/json',
data: JSON.stringify({
phone: '905555555555',
event: { title: 'Meeting', description: 'Weekly review', startDate: '2026-10-15T14:00' }
}),
success: function(res) { console.log(res); }
});
const axios = require('axios');
axios.post('https://server.wbox.me/v1/send/event', {
phone: '905555555555',
event: { title: 'Meeting', description: 'Weekly review', startDate: '2026-10-15T14:00' }
}, {
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' }
}).then(res => console.log(res.data));
import requests
response = requests.post(
'https://server.wbox.me/v1/send/event',
headers={'Authorization': 'Bearer sk_YOUR_KEY'},
json={
'phone': '905555555555',
'event': {'title': 'Meeting', 'description': 'Weekly review', 'startDate': '2026-10-15T14:00'}
}
)
print(response.json())
$ch = curl_init('https://server.wbox.me/v1/send/event');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer sk_YOUR_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'phone' => '905555555555',
'event' => [
'title' => 'Meeting',
'description' => 'Weekly review',
'startDate' => '2026-10-15T14:00'
]
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
require 'net/http'
require 'json'
require 'uri'
uri = URI.parse("https://server.wbox.me/v1/send/event")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer sk_YOUR_KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"phone" => "905555555555",
"event" => {
"title" => "Meeting",
"description" => "Weekly review",
"startDate" => "2026-10-15T14:00"
}
})
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
/v1/send/poll
Send an interactive poll with multiple options.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone | String | Yes | Number with country code. |
| message | String | Yes | Anketin Başlığı/Sorusu. |
| options | Array | Yes | Anket şıkları (örn: ["Evet", "Hayır"]). En az 2 şık. |
Code Examples
curl -X POST https://server.wbox.me/v1/send/poll \
-H "Authorization: Bearer sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "905555555555",
"message": "Question?",
"options": ["Yes", "No"]
}'
fetch('https://server.wbox.me/v1/send/poll', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_YOUR_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
phone: '905555555555',
message: 'Question?',
options: ['Yes', 'No']
})
})
.then(res => res.json())
.then(console.log);
$.ajax({
url: 'https://server.wbox.me/v1/send/poll',
method: 'POST',
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' },
contentType: 'application/json',
data: JSON.stringify({
phone: '905555555555',
message: 'Question?',
options: ['Yes', 'No']
}),
success: function(res) { console.log(res); }
});
const axios = require('axios');
axios.post('https://server.wbox.me/v1/send/poll', {
phone: '905555555555',
message: 'Question?',
options: ['Yes', 'No']
}, {
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' }
}).then(res => console.log(res.data));
import requests
response = requests.post(
'https://server.wbox.me/v1/send/poll',
headers={'Authorization': 'Bearer sk_YOUR_KEY'},
json={'phone': '905555555555', 'message': 'Question?', 'options': ['Yes', 'No']}
)
print(response.json())
$ch = curl_init('https://server.wbox.me/v1/send/poll');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer sk_YOUR_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'phone' => '905555555555',
'message' => 'Question?',
'options' => ['Yes', 'No']
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
require 'net/http'
require 'json'
require 'uri'
uri = URI.parse("https://server.wbox.me/v1/send/poll")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer sk_YOUR_KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"phone" => "905555555555",
"message" => "Question?",
"options" => ["Yes", "No"]
})
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
Session Management
Endpoints for managing WhatsApp connection and sessions.
/v1/session/status
WhatsApp oturumunun bağlantı durumunu kontrol edin.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| device_id | Integer | No | Belirtilmezse ilk cihaz kullanılır. |
Code Examples
curl -X GET https://server.wbox.me/v1/session/status?device_id=1 \ -H "Authorization: Bearer sk_YOUR_KEY"
fetch('https://server.wbox.me/v1/session/status?device_id=1', {
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' }
})
.then(res => res.json())
.then(console.log);
$.ajax({
url: 'https://server.wbox.me/v1/session/status?device_id=1',
method: 'GET',
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' },
success: function(res) { console.log(res); }
});
const axios = require('axios');
axios.get('https://server.wbox.me/v1/session/status?device_id=1', {
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' }
}).then(res => console.log(res.data));
import requests
response = requests.get(
'https://server.wbox.me/v1/session/status?device_id=1',
headers={'Authorization': 'Bearer sk_YOUR_KEY'}
)
print(response.json())
$ch = curl_init('https://server.wbox.me/v1/session/status?device_id=1');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer sk_YOUR_KEY']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
require 'net/http'
require 'uri'
uri = URI.parse("https://server.wbox.me/v1/session/status?device_id=1")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer sk_YOUR_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
Response Example
{
"device_id": 1,
"isReady": true,
"state": "INITIALIZED",
"qr": null,
"status": "connected"
}
/v1/session/start
WhatsApp oturumunu başlatır ve QR kod üretimini tetikler.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| device_id | Integer | Yes | Başlatılacak Cihaz ID'si. |
Code Examples
curl -X POST https://server.wbox.me/v1/session/start \
-H "Authorization: Bearer sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "device_id": 1 }'
fetch('https://server.wbox.me/v1/session/start', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_YOUR_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ device_id: 1 })
})
.then(res => res.json())
.then(console.log);
$.ajax({
url: 'https://server.wbox.me/v1/session/start',
method: 'POST',
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' },
contentType: 'application/json',
data: JSON.stringify({ device_id: 1 }),
success: function(res) { console.log(res); }
});
const axios = require('axios');
axios.post('https://server.wbox.me/v1/session/start', {
device_id: 1
}, {
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' }
}).then(res => console.log(res.data));
import requests
response = requests.post(
'https://server.wbox.me/v1/session/start',
headers={'Authorization': 'Bearer sk_YOUR_KEY'},
json={'device_id': 1}
)
print(response.json())
$ch = curl_init('https://server.wbox.me/v1/session/start');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer sk_YOUR_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['device_id' => 1]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
require 'net/http'
require 'json'
require 'uri'
uri = URI.parse("https://server.wbox.me/v1/session/start")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer sk_YOUR_KEY"
request["Content-Type"] = "application/json"
request.body = JSON.dump({ "device_id" => 1 })
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
/v1/session/qr
Mevcut QR kodu Base64 JSON olarak veya doğrudan resim olarak döndürür.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| device_id | Integer | Yes | Cihaz ID'si. |
| format | String | No | base64 (önerilen) veya raw (default) |
Code Examples
curl -X GET https://server.wbox.me/v1/session/qr?device_id=1&format=base64 \ -H "Authorization: Bearer sk_YOUR_KEY"
fetch('https://server.wbox.me/v1/session/qr?device_id=1&format=base64', {
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' }
})
.then(res => res.json())
.then(data => {
if (data.qr_base64) document.getElementById('qr-img').src = data.qr_base64;
});
$.ajax({
url: 'https://server.wbox.me/v1/session/qr?device_id=1&format=base64',
method: 'GET',
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' },
success: function(res) {
if (res.qr_base64) $('#qr-img').attr('src', res.qr_base64);
}
});
const axios = require('axios');
axios.get('https://server.wbox.me/v1/session/qr?device_id=1&format=base64', {
headers: { 'Authorization': 'Bearer sk_YOUR_KEY' }
}).then(res => console.log(res.data.qr_base64));
import requests
response = requests.get(
'https://server.wbox.me/v1/session/qr?device_id=1&format=base64',
headers={'Authorization': 'Bearer sk_YOUR_KEY'}
)
print(response.json()['qr_base64'])
$ch = curl_init('https://server.wbox.me/v1/session/qr?device_id=1&format=base64');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer sk_YOUR_KEY']);
$response = json_decode(curl_exec($ch), true);
echo $response['qr_base64'];
curl_close($ch);
require 'net/http'
require 'uri'
require 'json'
uri = URI.parse("https://server.wbox.me/v1/session/qr?device_id=1&format=base64")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer sk_YOUR_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts JSON.parse(response.body)['qr_base64']
Other Information
General response formats and error handling.
Responses
Example Success Output (200 OK)
{
"success": true,
"message": "Message sent successfully",
"to": "905551234567"
}
Error Codes
Unauthorized
Invalid or missing API Key.
Service Unavailable
WhatsApp client not ready (Scan QR code).
Bad Request
Missing required parameters (phone, message).