List Calls
Returns a list of all calls made from your workspace, newest first.
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,
"statusCode": 200,
"data": [
{
"id": "6a339ffbd2bbdb6b4d040c29",
"called_at": null,
"callee_number": "9871530000",
"caller_number": "8071387279",
"campaign_id": null,
"campaign_name": null,
"agent_id": "6a3129fa52acd1721552a434",
"agent_name": "Customer Support Agent",
"status": "scheduled",
"cost": 0,
"call_type": "outbound",
"call_hungup_by": null,
"should_charge": false
}
]
}
/call/logs
Target server for requests. Edit to use your own host.
Username for basic authentication
Password for basic authentication
api_key:api_key_secret
and pass the result in the Authorization header:
``http
Authorization: Basic BASE64(api_key:api_key_secret)
``
Generate your API Key and Secret from **Profile → Integrations →
Build with Twenty2 API → Create new**.
Your Twenty2 Workspace ID. To find it, click the copy icon next to Switch Workspace at the bottom-left of the platform and select Copy workspace ID.
Request Preview
Response
Response will appear here after sending the request
Authentication
Basic authentication credentials. Base64-encode your credentials in the format api_key:api_key_secret
and pass the result in the Authorization header:
Authorization: Basic BASE64(api_key:api_key_secret)
Generate your API Key and Secret from Profile → Integrations → Build with Twenty2 API → Create new.
Headers
Your Twenty2 Workspace ID. To find it, click the copy icon next to Switch Workspace at the bottom-left of the platform and select Copy workspace ID.
699ed3b91ee5bee389dcb6a3Responses
Array of call objects, newest first.