Unable to get Vapi Analytics
# support
c
Hi, I am trying to get the number of calls taken by particular assistant by its ID. However, the SDK is not upto date and I can't find proper query format for making the api request. Can. you please point me to an example for it? I was referring this: https://docs.vapi.ai/api-reference/analytics/get
v
message has been deleted
@ChasingClouds Certainly! To retrieve the number of calls taken by a particular assistant by its ID, you would typically use the analytics endpoint of the VAPI. However, since you mentioned that the SDK is not up to date and you're having trouble finding the proper query format, I'll guide you through the process. The endpoint you're referring to seems to be for analytics, but you might actually need to use the "List Calls" endpoint to filter calls by the assistant's ID and then count them. The "List Calls" endpoint allows you to retrieve a list of calls with various query parameters that you can use to filter the results. Here's a general example of how you might structure your API request to list calls taken by a specific assistant:
Copy code
http
GET /calls?assistant_id={assistant_id}
You would replace
{assistant_id}
with the actual ID of the assistant you're interested in. This request would return a list of calls associated with that assistant, and you could then count the number of calls in the response. Since you're looking for an example, here's a hypothetical cURL command that demonstrates how to make such a request:
Copy code
bash
curl -X GET "https://api.vapi.ai/calls?assistant_id=12345" \
     -H "Authorization: Bearer {api_key}" \
     -H "Content-Type: application/json"
In this command, replace
{api_key}
with your actual API key and
12345
with the assistant's ID. If you need further assistance with constructing the correct API request or if you have any other questions, please let me know!
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
c
Using "list calls" does not make sense when you take a large number of calls and you need realtime analytics.
I want to get analytics for a specific assistant? Like total no. of calls taken. Total cost.
m
solved in #1211484481848873020 lmk if you need more help
c
make sure to check on my comment on this in general. Not rue if you are tracking your calls.
c
@Vapi Close the ticket.
v
@ChasingClouds Sweet. Have a great day!
4 Views