Call Log Access API 3.0
The WebFones Call Records API allows you to retrieve call log records for your account, including details such as call time, caller/callee, and disposition. This API is designed for integration with CRMs, reporting tools, and automation systems that need access to call history.
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 API key (or per IP if no key)
- Response Code: 429 when limit exceeded
json
{
"error": "Too many requests for this API key, please try again later."
}
Endpoints
Call Records
List Call Records After Timestamp
http
GET /call_log/records_after_timestamp?timestamp=
Retrieve all call records for the authenticated account after the specified timestamp.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| —————— | ———— | ————— | ——————————————————————- |
| timestamp | string | Yes | Only return calls after this timestamp (format: YYYY-MM-DD HH:MM:SS) |
json
{
"success": true,
"count": 2,
"records": [
{
"rid": 211159,
"call_timestamp": "2025-07-01 20:54:53",
"cidname_outside": "B WHITTAKER",
"cidext_inside": "3203",
"direction": "OUTGOING",
"cidnumber_outside": "(111) 111-1111",
"cidnumber_inside": "(111) 111-1111, x3203",
"disposition": "ANSWERED",
...
}
]
}
If there are no records:
json
{
"success": true,
"count": 0,
"records": []
}
Error Codes
- 400 Bad Request
json
{
"error": "Missing timestamp in query"
}
- 401 Unauthorized
json
{
"error": "Missing API key"
}
- 403 Forbidden
json
{
"error": "Invalid API key"
}
- 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 GET \
-H "x-api-key: YOUR_API_KEY" \
"https://api.webfones.com:2343/call_log/records_after_timestamp?timestamp=2025-07-01%2014:53:43"
Using PHP
php
$call) {
echo ($i+1) . ". Call ID: " . ($call['rid'] ?? 'N/A') . ", Timestamp: " . ($call['call_timestamp'] ?? 'N/A') . ", Caller: " . ($call['cidnumber_outside'] ?? 'N/A') . "\n";
}
Using JavaScript
javascript
const apiKey = 'YOUR_API_KEY';
const baseUrl = 'https://api.webfones.com:2343';
const timestamp = new Date(Date.now() - 6 3600 1000).toISOString().replace('T', ' ').substring(0, 19); // 'YYYY-MM-DD HH:MM:SS'
const url = ${ baseUrl }/call_log/records_after_timestamp?timestamp=${encodeURIComponent(timestamp)};
fetch(url, {
method: 'GET',
headers: {
'x-api-key': apiKey,
'Accept': 'application/json'
}
})
.then(res => res.json())
.then(data => {
if (data.records && data.records.length > 0) {
data.records.forEach((call, i) => {
console.log(${ i+1 }. Call ID: ${call.rid}, Timestamp: ${call.call_timestamp}, Caller: ${call.cidnumber_outside});
});
} else {
console.log('No calls found in the last 6 hours.');
}
});
Using Python
python
import requests
from datetime import datetime, timedelta
API_KEY = ‘YOUR_API_KEY’
BASE_URL = ‘https://api.webfones.com:2343’
timestamp = (datetime.utcnow() – timedelta(hours=6)).strftime(‘%Y-%m-%d %H:%M:%S’)
url = f’{BASE_URL}/call_log/records_after_timestamp?timestamp={timestamp.replace(” “, “%20”)}’
headers = {
‘x-api-key’: API_KEY,
‘Accept’: ‘application/json’
}
response = requests.get(url, headers=headers)
if response.status_code != 200:
print(f’API error ({response.status_code}): {response.text}’)
exit(1)
data = response.json()
if not data.get(‘records’):
print(‘No calls found in the last 6 hours.’)
else:
for i, call in enumerate(data[‘records’]):
print(f”{i+1 }. Call ID: {call.get(‘rid’, ‘N/A’)}, Timestamp: {call.get(‘call_timestamp’, ‘N/A’)}, Caller: {call.get(‘cidnumber_outside’, ‘N/A’)}”)
Support
For questions, API key requests, or troubleshooting, contact your WebFones administrator or support team.