Get call id on front
# support
b
I want to get the call id int eht end of the call, but neither vapi.on("call-start", nor vapi.on("call-end", take arguemnt on function. How can I get this ID ?
v
You can continue this conversation by mentioning me in the message.
@Barden To obtain the call ID at the end of the call, you would typically need to have access to the call context or a mechanism provided by the API that tracks the call ID throughout the call session. Since the
vapi.on("call-end")
event does not provide an argument for the call ID directly, you may need to use another method provided by the API to retrieve the call ID. If VAPI provides a method to get the current call ID during the call or stores it in a context accessible by your code, you should use that. If such a method is not available or documented, you may need to maintain the call ID in your application's state when the call starts and then reference it when the call ends. If you're unsure how to proceed or if the API documentation does not provide clear instructions on how to retrieve the call ID, please reach out to the support team for more information on this. They should be able to guide you on the proper way to obtain the call ID based on the specifics of the VAPI.
Got it. Tagging @User for additional help.
s
when you initate call in response you get the call id.
b
Thank you, but the function is marked as void, it doesn’t take any argument. If I try anyway, it’s undefined
sorry I wasn't on the righ place, vapi.start() return the call object. thank you
3 Views