Getting Structured Data output from a completed ca...
# support
k
Hi, I am kind of new to VAPI, and have successfully implemented what we need except for one small thing. Once a call is complete, we are looking to extract the structuredData output from analysis plan. None of the APIs are clearly documented to show how to do that. Looking for help.
v
@krthkntrjn Hello! I'm glad to hear that you've successfully implemented most of what you need with VAPI. To extract the structured data output from the analysis plan after a call is complete, you'll need to ensure that the
structuredDataPrompt
and optionally the
structuredDataSchema
are properly set up in your analysis plan configuration. Once you have configured these, the structured data extraction should occur automatically as part of the call analysis process. The output will be stored in
call.analysis.structuredData
. If you have already set up your analysis plan with the structured data prompt and schema, you should be able to retrieve the structured data from the call analysis endpoint or from the storage where your call analysis results are being sent. If you need further assistance with the specific API call or the configuration, please let me know, and I'll be happy to help you with more detailed instructions.
You can continue this conversation by mentioning me in the message.
k
yes it is setup correctly as I can see the data i expect in the call logs on the vapi dashboard console. But couldn't figure out how to get via API as we are using web snippet to initiate the call from our bot with users.
how to use the call analysis endpoint is what i am really struggling with
s
Hey @krthkntrjn To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help me figure out what went wrong!
k
Hi @User I just direct messaged you the details and a sample call id, but the problem is not with anything going wrong with the call itself. We are using ephemeral assistant dynamically, so the call parameters are passed using code. There is no predefined assistant that we use as our system prompt is dynamic. It is mainly to do with us not being able to retrieve call id when using web snippet, so we can access the api to get the post call analysis and structured Data. all of that is working fine as we can see all our calls and our structured data visible in the call logs as expected. after giving up on web snippet, we tried using web sdk with react, and ran into many more issues while we were able to get the callid we needed with every ephemeral assistant call, but that is where all the good things stop for us. With web sdk, we had multiple issues, vapi.stop() will never work no matter how we try, so we are unable to end the call at the click of the button or otherwise. We are also not able to get the analysisPlan to work with web sdk, which was working fine in web snippet. In our use case, structuredData retrieval after every call is highly important. But with web snippet, there is no callid, so we can't retrieve structuredData, with web sdk, the analysis plan doesn't work and neither does the vapi.stop. To make things worse, when we say "goodbye" to try ending the call, the bot speaks out the thank you message, but also starts reading our analysis plan out loud. @User
s
@krthkntrjn with each call created in response you get the call object back which contains the required customer details right before the call or next message. Do you checked in Call object? Refrernce for the code maknig web calls: https://github.com/VapiAI/client-sdk-html-script-tag/blob/a5df95c53bf43b5cef186fef34ecb975df4493f4/src/listeners.js#L12
@krthkntrjn do let me know if you require furrther help
43 Views