I want to gather cummulative call minutes of an as...
# support
r
how to do I collect cummulative call minutes of an assistant ? I will be adding an API to the server url section so that I can send this data to the API.
v
@Richard To collect cumulative call minutes of an assistant, you would typically need to track the duration of each call handled by that assistant and then sum up these durations. If you're looking to integrate this functionality with VAPI, you would need to: 1. Implement logging for each call's duration on your system. 2. Accumulate the total call minutes for the assistant in question. 3. Send this data to your server API. Here's a general outline of the steps you might take: - **Track Call Durations**: Ensure that your system is set up to log the duration of each call that an assistant handles. This could involve starting a timer when the call begins and stopping it when the call ends. - **Store and Sum Durations**: Store these durations in a database or a stateful service, and create a method to sum these durations to get the cumulative call minutes for each assistant. - **Create an API Endpoint**: On your server, create an API endpoint that can receive and process the cumulative call minutes data. - **Send Data to Your API**: Once you have the cumulative call minutes, you can send this data to your server API. You would typically do this by making an HTTP request from your system to your API with the necessary data. If you need to perform these actions through VAPI, you would need to ensure that VAPI supports these operations or has the necessary endpoints for logging call durations and sending data to external APIs. If VAPI does not directly support these features, you may need to handle them with your own backend services. If you have specific endpoints or methods within VAPI that you are unsure about how to use, please provide more details, and I can assist you further. If you need to know how to send data to your server API, you would need to provide the API specifications so that I can guide you on how to structure the request.
You can continue this conversation by mentioning me in the message.
r
@Vapi which api endpoint of vapi should I use in order to fetch the cummulative call minutes with an assistant ID ?
v
@Richard VAPI itself may not provide a direct API endpoint to fetch cumulative call minutes for an assistant as this is typically a feature of analytics or reporting tools within a telephony or contact center platform. However, if you are tracking call durations within your own system, you would typically use your own API endpoint to fetch this data. If VAPI does offer such functionality, it would likely be documented in their API reference. Since I don't have access to VAPI's specific API documentation, I would recommend checking the documentation provided by VAPI for any reporting or analytics endpoints that might offer this data. If such an endpoint exists, it would likely require you to provide the
assistantId
as a parameter, and it would return the cumulative call minutes for that assistant. If you find that VAPI does not provide this data, you would need to implement it on your server: 1. Log each call's duration associated with an
assistantId
. 2. Sum the durations for each
assistantId
to calculate cumulative call minutes. 3. Expose an endpoint on your server that provides this data when requested. For example, your own API endpoint might look something like this:
Copy code
GET /api/assistants/{assistantId}/cumulative-call-minutes
This would return the cumulative call minutes for the specified assistant. If you need assistance with setting up your own server to track and expose this data, please provide more details about your current setup, and I can guide you through the process. If you're looking for a specific VAPI endpoint and it exists, please refer to the VAPI documentation or ask their support for more information.
r
@Shubham Bajaj bro I need your help with this
s
Hey @Richard did you tried using analytics API?
API Ref
https://docs.vapi.ai/api-reference/analytics/get
You can also use the following code as example https://dump.sahilsuman.me/s4iqc600.ts
Do let me know if you require further help.
r
Thanks a lot for this man ! Actually I am also looking for a way to do the same thing in a make.com scenario
s
Yes the id here is call id and duration will be in seconds.