Dialer API 3.0
The WebFones Dialer API allows you to programmatically initiate outbound calls from your PBX system via a secure HTTP endpoint. This API is designed for integration with web apps, CRMs, and automation tools that need to trigger calls for users or agents.
Base URL
https://api.webfones.com:2343
Authentication
All API endpoints require authentication using an API key. The API key must be included in the request headers.
Required Headers
http
x-api-key: YOUR_API_KEY
Alternative:
http
Authorization: Bearer YOUR_API_KEY
Rate Limiting
- Limit: 1000 requests per 15-minute window per IP address
- Response Code: 429 when limit exceeded
Endpoints
Dialer
Initiate Outbound Call
http
POST /dialer/call
Initiate an outbound call from a specific extension to a phone number.
Request Body
json
{
"extension": "309",
"phonenumber": "15808675309"
}
| Field | Type | Required | Description |
|---|---|---|---|
| ——————- | ———— | ————— | ——————————————————————- |
| extension | string | Yes | The extension number to originate the call from |
| phonenumber | string | Yes | The destination phone number to call |
json
{
"status": "200",
"message": "Success"
}
If there is an error, you may receive:
json
{
"message": "invalid extension"
}
Or:
json
{
"error": "Invalid API key"
}
Or:
json
{
"message": "Internal error",
"details": "..."
}
Error Codes
- 400 Bad Request
json
{
"message": "invalid extension"
}
- 401 Unauthorized
json
{
"error": "API key is required",
"message": "Please provide API key in x-api-key header or Authorization header"
}
- 403 Forbidden
json
{
"error": "Invalid API key",
"message": "The provided API key is not valid or has been revoked"
}
- 404 Not Found
json
{
"error": "Not found"
}
- 429 Too Many Requests
json
{
"error": "Too many requests from this IP, please try again later."
}
- 500 Internal Server Error
json
{
"error": "Internal server error",
"message": "An unexpected error occurred",
"timestamp": "2025-06-19T10:30:00.000Z"
}
Example Requests
Using curl
bash
curl -X POST \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"extension": "309", "phonenumber": "15808675309"}' \
https://api.webfones.com:2343/dailer/call
Using PHP
php
$extension,
'phonenumber' => $phonenumber
]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo "HTTP $httpCode\n";
echo "Response:\n$response\n";
Using JavaScript
javascript
const apiKey = ‘YOUR_API_KEY’;
const baseUrl = ‘https://api.webfones.com:2343’;
const headers = {
‘x-api-key’: apiKey,
‘Content-Type’: ‘application/json’
};
const dial = async (extension, phonenumber) => {
const response = await fetch($baseUrl/dailer/call, {
method: ‘POST’,
headers: headers,
body: JSON.stringify({ extension, phonenumber })
});
if (!response.ok) {
throw new Error(HTTP error! status: ${response.status});
}
return await response.json();
};
// Usage
const result = await dial(‘309’, ‘15808675309’);
Using Python
python
import requests
import json
API_KEY = ‘YOUR_API_KEY’
BASE_URL = ‘https://api.webfones.com:2343’
headers = {
‘x-api-key’: API_KEY,
‘Content-Type’: ‘application/json’
}
def dial(extension, phonenumber):
response = requests.post(
f’{BASE_URL}/dailer/call’,
headers=headers,
json={‘extension’: extension, ‘phonenumber’: phonenumber}
)
response.raise_for_status()
return response.json()
- Usage
Device/Channel Logic
- The API will attempt to ring all devices associated with the extension, including mobile, softphone, and registered equipment.
- If no devices are available, you will receive a
no deviceserror.
Support
For questions, API key requests, or troubleshooting, contact your WebFones administrator or support team.