V 2.0
Call Report
Introduction
This document provides comprehensive information about the Call Report API endpoints. These endpoints allow retrieving, filtering, and exporting call log reports in various formats (CSV, Excel, PDF). The API supports advanced filtering capabilities including date ranges, agent filtering, duration filters, call types, and custom call analysis fields.
Base URL
The base URL for this API endpoint is: v4-api.deepcall.com/api/v2/callreport
Authentication
Authentication is required for all endpoints. It can be done in two ways:
- Using
ssid(Session ID) - Using
userIdandtoken
Note: When userId and token are used, ssid should not be present in the request.
Common Error Codes
These error codes can be returned by any endpoint in this API. Endpoint-specific errors are documented in their respective sections.
Authentication & Authorization Errors
| Error Code | Error Message | Description | Solution |
|---|---|---|---|
| 1000 | Invalid parameters | Request validation failed or authentication invalid | Check all required parameters are provided |
| 1014 | Invalid token | Authentication token is expired or invalid | Generate a new token or use valid ssid |
| 1015 | Permission denied | User does not have LIST_CALL_LOG permission | Contact admin to grant required permissions |
| 1047 | Invalid Request Data | Request body is empty or malformed | Ensure request body is valid JSON |
System Errors
| Error Code | Error Message | Description | Solution |
|---|---|---|---|
| 1009 | Something went wrong | Unexpected server error occurred | Retry the request or contact support |
| 1010 | Error in DB connect | Database connection is not available | Check system status or retry after some time |
Common Error Response Format
All error responses follow this structure:
{
"status": "error",
"message": "Error description here",
"code": 1000
}
Excel Request Bulk
Endpoint
- Method: POST
-
Path:
v4-api.deepcall.com/api/v2/callreport/exportCsv/
Description
The Export to CSV endpoint generates and uploads call reports in CSV format to cloud storage. It applies the same filters as the list endpoint and returns a downloadable URL. This is ideal for smaller datasets that need immediate export. The endpoint supports both regular call reports and masked number reports.
Use Cases
- Quick export of filtered call reports
- Downloading call data for offline analysis
- Importing call logs into Excel or other tools
- Sharing call reports with team members
- Backup and archival purposes
- Integration with data analysis tools
- Custom reporting requirements
- Exporting masked number reports for privacy compliance
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | string | Yes* | User ID for authentication (*required if ssid not provided) |
| token | string | Yes* | Authentication token (*required if ssid not provided) |
| ssid | string | Yes* | Session ID (*required if userId/token not provided) |
| filter | object | No | Filter criteria object (see Filter Parameters section) |
| priorityFilter | string | No | Base64 encoded priority filter for advanced filtering |
| fileType | string | No | File type for export (default: "CSV") |
| module | string | No | Module type - "LOG_REPORT" or "MASK_REPORT" (default: "LOG_REPORT") |
| requestId | string | No | Request ID for tracking export job |
Module Types
| Value | Description |
|---|---|
| LOG_REPORT | Regular call reports (default) |
| MASK_REPORT | Masked number call reports |
Request Examples
Example 1: Export All Calls for Date Range
{
"ssid": "{{ssid}}",
"filter": {
"dtGte": "2025-11-20 00:00:00",
"dtLte": "2025-11-23 23:59:59"
},
"fileType": "CSV",
"module": "LOG_REPORT"
}
Example 2: Export Filtered by Agent
{
"userId": "{{userid}}",
"token": "{{token}}",
"filter": {
"agtIds": ["1", "2", "3"],
"dtGte": "2025-11-20 00:00:00",
"dtLte": "2025-11-23 23:59:59"
},
"fileType": "CSV",
"module": "LOG_REPORT"
}
Example 3: Export Campaign Calls
{
"ssid": "{{ssid}}",
"filter": {
"campId": 123,
"st": ["answered"],
"dtGte": "2025-11-01 00:00:00",
"dtLte": "2025-11-30 23:59:59"
},
"fileType": "CSV",
"module": "LOG_REPORT"
}
Example 4: Export Masked Number Reports
{
"ssid": "{{ssid}}",
"filter": {
"dtGte": "2025-11-20 00:00:00",
"dtLte": "2025-11-23 23:59:59"
},
"fileType": "CSV",
"module": "MASK_REPORT"
}
Response Details
Success Response
Status Code: 200
{
"code": 200,
"status": "success",
"message": "File uploaded successfully",
"data": {
"filename": "call_report_20251123_103045.csv",
"url": "https://storage.example.com/reports/call_report_20251123_103045.csv",
"size": 1024567,
"recordCount": 1234
}
}
Response Field Descriptions
| Field | Type | Description |
|---|---|---|
| code | number | Response code (200 for success) |
| status | string | Response status ("success") |
| message | string | Success message |
| data.filename | string | Generated CSV filename |
| data.url | string | Downloadable URL for CSV file |
| data.size | number | File size in bytes |
| data.recordCount | number | Number of records exported |
Error Response Examples
Error 1: Permission Denied
Status Code: 200
{
"status": "error",
"message": "Permission denied",
"code": 1015
}
Error 2: File Generation Failed
{
"status": "error",
"message": "Something went wrong",
"code": 1009
}
Excel Request Bulk
var axios = require('axios');
var data = '{"ssid": "{{ssid}}","filter": {"dtGte": "2025-11-01 00:00:00","dtLte": "2025-11-30 23:59:59"},"requestId":"{{objectid}}","fileType": "CSV","module": "LOG_REPORT"}';
var config = {
method: 'post',
url: 'https://{{brand}}/api/v2/CallReport/exportCsvBulk',
headers: {
'Content-Length': ''
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
setUrl('https://{{brand}}/api/v2/CallReport/exportCsvBulk');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Length' => ''
));
$request->setBody('{"ssid": "{{ssid}}","filter": {"dtGte": "2025-11-01 00:00:00","dtLte": "2025-11-30 23:59:59"},"requestId":"{{objectid}}","fileType": "CSV","module": "LOG_REPORT"}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}import http.client
conn = http.client.HTTPSConnection("{{brand}}")
payload = "{\"ssid\": \"{{ssid}}\",\"filter\": {\"dtGte\": \"2025-11-01 00:00:00\",\"dtLte\": \"2025-11-30 23:59:59\"},\"requestId\":\"{{objectid}}\",\"fileType\": \"CSV\",\"module\": \"LOG_REPORT\"}"
headers = {
'Content-Length': ''
}
conn.request("POST", "/api/v2/CallReport/exportCsvBulk", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))var client = new RestClient("https://{{brand}}/api/v2/CallReport/exportCsvBulk");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
var body = @"{" + "\n" +
@" ""ssid"": ""{{ssid}}""," + "\n" +
@" ""filter"": {" + "\n" +
@" ""dtGte"": ""2025-11-01 00:00:00""," + "\n" +
@" ""dtLte"": ""2025-11-30 23:59:59""" + "\n" +
@" }," + "\n" +
@" ""requestId"":""{{objectid}}""," + "\n" +
@" ""fileType"": ""CSV""," + "\n" +
@" ""module"": ""LOG_REPORT""" + "\n" +
@"}";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);curl --location -g --request POST 'https://{{brand}}/api/v2/CallReport/exportCsvBulk' \
--data-raw '{
"ssid": "{{ssid}}",
"filter": {
"dtGte": "2025-11-01 00:00:00",
"dtLte": "2025-11-30 23:59:59"
},
"requestId":"{{objectid}}",
"fileType": "CSV",
"module": "LOG_REPORT"
}'var request = http.Request('POST', Uri.parse('https://{{brand}}/api/v2/CallReport/exportCsvBulk'));
request.body = '''{\n "ssid": "{{ssid}}",\n "filter": {\n "dtGte": "2025-11-01 00:00:00",\n "dtLte": "2025-11-30 23:59:59"\n },\n "requestId":"{{objectid}}",\n "fileType": "CSV",\n "module": "LOG_REPORT"\n}''';
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://%7B%7Bbrand%7D%7D/api/v2/CallReport/exportCsvBulk"
method := "POST"
payload := strings.NewReader(`{
"ssid": "{{ssid}}",
"filter": {
"dtGte": "2025-11-01 00:00:00",
"dtLte": "2025-11-30 23:59:59"
},
"requestId":"{{objectid}}",
"fileType": "CSV",
"module": "LOG_REPORT"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}POST /api/v2/CallReport/exportCsvBulk HTTP/1.1
Host: {{brand}}
Content-Length: 191
{
"ssid": "{{ssid}}",
"filter": {
"dtGte": "2025-11-01 00:00:00",
"dtLte": "2025-11-30 23:59:59"
},
"requestId":"{{objectid}}",
"fileType": "CSV",
"module": "LOG_REPORT"
}OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "{\n \"ssid\": \"{{ssid}}\",\n \"filter\": {\n \"dtGte\": \"2025-11-01 00:00:00\",\n \"dtLte\": \"2025-11-30 23:59:59\"\n },\n \"requestId\":\"{{objectid}}\",\n \"fileType\": \"CSV\",\n \"module\": \"LOG_REPORT\"\n}");
Request request = new Request.Builder()
.url("https://{{brand}}/api/v2/CallReport/exportCsvBulk")
.method("POST", body)
.addHeader("Content-Length", "")
.build();
Response response = client.newCall(request).execute();var myHeaders = new Headers();
myHeaders.append("Content-Length", "");
var raw = "{\n \"ssid\": \"{{ssid}}\",\n \"filter\": {\n \"dtGte\": \"2025-11-01 00:00:00\",\n \"dtLte\": \"2025-11-30 23:59:59\"\n },\n \"requestId\":\"{{objectid}}\",\n \"fileType\": \"CSV\",\n \"module\": \"LOG_REPORT\"\n}";
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://{{brand}}/api/v2/CallReport/exportCsvBulk", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://%7B%7Bbrand%7D%7D/api/v2/CallReport/exportCsvBulk");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Length: ");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\n \"ssid\": \"{{ssid}}\",\n \"filter\": {\n \"dtGte\": \"2025-11-01 00:00:00\",\n \"dtLte\": \"2025-11-30 23:59:59\"\n },\n \"requestId\":\"{{objectid}}\",\n \"fileType\": \"CSV\",\n \"module\": \"LOG_REPORT\"\n}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
#import
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://%7B%7Bbrand%7D%7D/api/v2/CallReport/exportCsvBulk"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Content-Length": @""
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\n \"ssid\": \"{{ssid}}\",\n \"filter\": {\n \"dtGte\": \"2025-11-01 00:00:00\",\n \"dtLte\": \"2025-11-30 23:59:59\"\n },\n \"requestId\":\"{{objectid}}\",\n \"fileType\": \"CSV\",\n \"module\": \"LOG_REPORT\"\n}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER); open Lwt
open Cohttp
open Cohttp_lwt_unix
let postData = ref "{\n \"ssid\": \"{{ssid}}\",\n \"filter\": {\n \"dtGte\": \"2025-11-01 00:00:00\",\n \"dtLte\": \"2025-11-30 23:59:59\"\n },\n \"requestId\":\"{{objectid}}\",\n \"fileType\": \"CSV\",\n \"module\": \"LOG_REPORT\"\n}";;
let reqBody =
let uri = Uri.of_string "https://%7B%7Bbrand%7D%7D/api/v2/CallReport/exportCsvBulk" in
let headers = Header.init ()
|> fun h -> Header.add h "Content-Length" ""
in
let body = Cohttp_lwt.Body.of_string !postData in
Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Length", "")
$body = "{`n `"ssid`": `"{{ssid}}`",`n `"filter`": {`n `"dtGte`": `"2025-11-01 00:00:00`",`n `"dtLte`": `"2025-11-30 23:59:59`"`n },`n `"requestId`":`"{{objectid}}`",`n `"fileType`": `"CSV`",`n `"module`": `"LOG_REPORT`"`n}"
$response = Invoke-RestMethod 'https://{{brand}}/api/v2/CallReport/exportCsvBulk' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Jsonrequire "uri"
require "net/http"
url = URI("https://{{brand}}/api/v2/CallReport/exportCsvBulk")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Length"] = ""
request.body = "{\n \"ssid\": \"{{ssid}}\",\n \"filter\": {\n \"dtGte\": \"2025-11-01 00:00:00\",\n \"dtLte\": \"2025-11-30 23:59:59\"\n },\n \"requestId\":\"{{objectid}}\",\n \"fileType\": \"CSV\",\n \"module\": \"LOG_REPORT\"\n}"
response = https.request(request)
puts response.read_body
printf '{
"ssid": "{{ssid}}",
"filter": {
"dtGte": "2025-11-01 00:00:00",
"dtLte": "2025-11-30 23:59:59"
},
"requestId":"{{objectid}}",
"fileType": "CSV",
"module": "LOG_REPORT"
}'| http --follow --timeout 3600 POST 'https://{{brand}}/api/v2/CallReport/exportCsvBulk' \
Content-Length:import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = "{\n \"ssid\": \"{{ssid}}\",\n \"filter\": {\n \"dtGte\": \"2025-11-01 00:00:00\",\n \"dtLte\": \"2025-11-30 23:59:59\"\n },\n \"requestId\":\"{{objectid}}\",\n \"fileType\": \"CSV\",\n \"module\": \"LOG_REPORT\"\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://{{brand}}/api/v2/CallReport/exportCsvBulk")!,timeoutInterval: Double.infinity)
request.addValue("", forHTTPHeaderField: "Content-Length")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
Example Response
[{"key":"Date"
"value":"Sun
23 Nov 2025 11:19:12 GMT"}
{"key":"Content-Type"
"value":"application\/json; charset=utf-8"}
{"key":"Content-Length"
"value":"58"}
{"key":"Connection"
"value":"keep-alive"}
{"key":"Access-Control-Allow-Origin"
"value":"*"}
{"key":"Access-Control-Allow-Methods"
"value":"GET
PUT
POST
DELETE
OPTIONS"}
{"key":"Access-Control-Allow-Headers"
"value":"session-token
Authorization
Origin
Accept
Content-Type
DNT
Authorization
Keep-Alive
User-Agent
X-Requested-With
If-Modified-Since
Cache-Control
Content-Type
Content-Range
Range"}
{"key":"Access-Control-Allow-Credentials"
"value":"true"}
{"key":"Vary"
"value":"Origin"}
{"key":"ETag"
"value":"W\/\"3a-Hk3L\/tap5L1EXKsavffpKR6hbuU\""}
{"key":"Strict-Transport-Security"
"value":"max-age=15724800; includeSubDomains"}
{"key":"Access-Control-Max-Age"
"value":"1728000"}]
{
"status": "error",
"message": "File Not Exists",
"code": 1009
}