List Calls
Retrieve a paginated list of past calls with optional filters.
curl -X GET "https://api.twentytwo.in/api/call/logs" \
-H "Content-Type: application/json" \
-H "x-workspace-id: 699ed3b91ee5bee389dcb6a3" \
-H "Authorization: Basic YOUR_CREDENTIALS"
import requests
import json
url = "https://api.twentytwo.in/api/call/logs"
headers = {
"Content-Type": "application/json",
"x-workspace-id": "699ed3b91ee5bee389dcb6a3",
"Authorization": "Basic YOUR_CREDENTIALS"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://api.twentytwo.in/api/call/logs", {
method: "GET",
headers: {
"Content-Type": "application/json",
"x-workspace-id": "699ed3b91ee5bee389dcb6a3",
"Authorization": "Basic YOUR_CREDENTIALS"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.twentytwo.in/api/call/logs", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-workspace-id", "699ed3b91ee5bee389dcb6a3")
req.Header.Set("Authorization", "Basic YOUR_CREDENTIALS")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.twentytwo.in/api/call/logs')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['x-workspace-id'] = '699ed3b91ee5bee389dcb6a3'
request['Authorization'] = 'Basic YOUR_CREDENTIALS'
response = http.request(request)
puts response.body
{
"success": true,
"calls": [
{
"call_id": "call_9c4d7e12ab",
"agent_id": "69de483c68b23495c853b43a",
"status": "completed",
"direction": "outbound",
"callee_phone": "9999999999",
"caller_phone": "9999999999",
"duration_seconds": 94,
"cost": "15.67 INR",
"started_at": "2024-12-25T10:00:00Z",
"ended_at": "2024-12-25T10:01:34Z"
}
]
}
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing credentials.",
"status": 401
}
}
GET
/call/logs
GET
Basic Authentication
Usernamestring
RequiredUsername for basic authentication
Passwordpassword
RequiredPassword for basic authentication
Pass your Basic auth token in the Authorization header along with your workspace ID in the x-workspace-id header on every request.
header
x-workspace-idstring
RequiredYour Twenty2 workspace ID
Request Preview
Response
Response will appear here after sending the request
Authentication
header
Authorizationstring
RequiredBasic authentication credentials. Pass your Basic auth token in the Authorization header along with your workspace ID in the x-workspace-id header on every request.
Headers
x-workspace-idstring
RequiredYour Twenty2 workspace ID
Responses
successboolean
callsarray
call_idstring
agent_idstring
statusstring
directionstring
callee_phonestring
caller_phonestring
duration_secondsinteger
coststring
started_atstring
ended_atstring
successboolean
errorobject
codestring
messagestring
statusinteger
Was this page helpful?
Last updated 2 weeks ago
Built with Documentation.AI