ChasingClouds
01/21/2025, 3:32 PMChasingClouds
01/21/2025, 3:54 PMVapi
01/21/2025, 3:54 PMChasingClouds
01/21/2025, 4:36 PMVapi
01/21/2025, 4:36 PMdarnold
01/21/2025, 4:49 PMMason | Building KOI
01/21/2025, 5:01 PMMason | Building KOI
01/21/2025, 5:02 PMChasingClouds
01/21/2025, 5:02 PMChasingClouds
01/21/2025, 5:02 PMMason | Building KOI
01/21/2025, 5:02 PMMason | Building KOI
01/21/2025, 5:02 PMChowderr
01/21/2025, 5:37 PMChasingClouds
01/21/2025, 6:23 PMChasingClouds
01/21/2025, 6:24 PMChasingClouds
01/21/2025, 6:24 PMChasingClouds
01/21/2025, 6:24 PMChasingClouds
01/21/2025, 6:25 PMChasingClouds
01/21/2025, 6:25 PMChasingClouds
01/21/2025, 6:26 PMChasingClouds
01/21/2025, 6:26 PMChasingClouds
01/21/2025, 6:26 PMChasingClouds
01/21/2025, 6:27 PMChasingClouds
01/21/2025, 6:27 PMChasingClouds
01/21/2025, 6:28 PMChowderr
01/21/2025, 6:36 PMMason | Building KOI
01/21/2025, 6:40 PMChasingClouds
01/21/2025, 6:40 PMMason | Building KOI
01/21/2025, 6:41 PMMason | Building KOI
01/21/2025, 6:41 PMMason | Building KOI
01/21/2025, 6:42 PMChowderr
01/21/2025, 6:45 PMChasingClouds
01/21/2025, 7:20 PMconst analyticsQuery = {
queries: [
{
table: "call",
groupBy: ["assistantId", "type", "status"],
name: "Call Analytics",
timeRange: {
step: "day",
start: "2024-01-01T00:00:00Z",
end: "2025-01-20T23:59:59Z",
timezone: "UTC"
},
operations: [
{
operation: "count",
column: "id",
alias: "call_count"
}]
}
]
};
// Make the fetch request
fetch('https://api.vapi.ai/analytics?assistantId=3a9e0733-6004-4995-b54d-f38af0701bfc', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
// You'll need to add your authentication header here
'Authorization': 'Bearer <my-token>'
},
body: JSON.stringify(
analyticsQuery
)
})
.then(response => response.json())
.then(data => {
console.log('Success:', data);
console.log(JSON.stringify(data, 2, null));
})
.catch((error) => {
console.error('Error:', error);
});
ChasingClouds
01/21/2025, 7:20 PM[{"name":"Call Analytics","timeRange":{"start":"2024-01-01T00:00:00.000Z","end":"2025-01-20T23:59:59.000Z","step":"day","timezone":"UTC"},"result":[{"date":"2024-10-20T00:00:00.000Z"
,"assistantId":"3a9e0733-6004-4995-b54d-f38af0701bfc","type":"inboundPhoneCall","status":"ended","callCount":"4"},{"date":"2024-10-20T00:00:00.000Z","assistantId":"d753855a-10e9-4334
-a2df-675fdcdda02a","type":"inboundPhoneCall","status":"ended","callCount":"15"},{"date":"2024-11-23T00:00:00.000Z","assistantId":"3a9e0733-6004-4995-b54d-f38af0701bfc","type":"inbou
ndPhoneCall","status":"ended","callCount":"1"},{"date":"2025-01-11T00:00:00.000Z","assistantId":"3a9e0733-6004-4995-b54d-f38af0701bfc","type":"outboundPhoneCall","status":"ended","ca
llCount":"1"},{"date":"2025-01-11T00:00:00.000Z","assistantId":"00000000-0000-0000-0000-000000000000","type":"webCall","status":"ended","callCount":"2"}]}]
Why are there different assistantIds involved as well???
Because it does not matter even if you query by ?assistantId or just query on the base analytics url.ChasingClouds
01/21/2025, 7:20 PMChasingClouds
01/21/2025, 7:21 PMChasingClouds
01/21/2025, 7:22 PMChowderr
01/21/2025, 7:25 PMChasingClouds
01/21/2025, 7:26 PMChasingClouds
01/21/2025, 7:27 PMChowderr
01/21/2025, 7:32 PMChasingClouds
01/21/2025, 7:34 PMChasingClouds
01/21/2025, 7:35 PMChasingClouds
01/21/2025, 7:35 PMChasingClouds
01/21/2025, 7:35 PMChowderr
01/21/2025, 7:38 PMChasingClouds
01/21/2025, 7:38 PMChasingClouds
01/21/2025, 7:38 PMChowderr
01/21/2025, 7:39 PMChasingClouds
01/21/2025, 7:39 PMChowderr
01/21/2025, 7:42 PMChasingClouds
01/21/2025, 7:42 PMChasingClouds
01/21/2025, 7:42 PMChasingClouds
01/21/2025, 7:42 PMChasingClouds
01/21/2025, 7:43 PMChasingClouds
01/21/2025, 7:43 PMChasingClouds
01/21/2025, 7:44 PMChasingClouds
01/21/2025, 7:44 PMChasingClouds
01/21/2025, 7:45 PMChasingClouds
01/21/2025, 7:45 PMVapi
01/21/2025, 7:45 PMShubham Bajaj
01/22/2025, 5:37 AMChasingClouds
01/22/2025, 6:09 AMChasingClouds
01/22/2025, 6:11 AMShubham Bajaj
01/23/2025, 6:35 PMShubham Bajaj
01/23/2025, 6:37 PMChasingClouds
01/30/2025, 3:30 AMShubham Bajaj
01/30/2025, 8:58 AMChasingClouds
01/30/2025, 3:08 PMChasingClouds
01/30/2025, 3:10 PMChasingClouds
01/30/2025, 3:11 PMChasingClouds
01/30/2025, 3:14 PMChasingClouds
01/30/2025, 4:58 PMChasingClouds
01/30/2025, 4:58 PMChasingClouds
01/30/2025, 5:05 PMChasingClouds
01/30/2025, 5:05 PMShubham Bajaj
02/01/2025, 3:15 AMShubham Bajaj
02/01/2025, 3:16 AM