How to call a webhook with a request body ?
# support
r
I am confused whether to create a tool for it or prompt it in a structured data. I have an API which can track the requests going to the Vapi's create call API but how do I fetch and send the following request body data to the API ? I just want the duration of requests in ms (the time the Vapi api took to execute), number of requests that had happened to the Vapi API, status code, method of the API and the endpoint the request was sent to. https://cdn.discordapp.com/attachments/1306601088677449748/1306601089570701366/image.png?ex=67374297&is=6735f117&hm=6ae2846e47a00da4456e603ba593f49c1796172dd463aec06e02ebfcf6606470&
s
Hey @Richard if understood correctly you want to keep an ledger for requests sent to Vapi and track the time it took, total duration of the call, status etc? If YES, then you have to do it using server-event status-update and end-of-call-report it cannot be done through analysis. If you can share more specicifc plan your expected outcome, and what's your plan on getting it done then it will be really helpful.
r
Hey @Shubham Bajaj, thanks for your response but how will I call an API along with the request headers ?
So in order to call the API one needs to add an API key and a specific set of data in the request body while making a call to the API
How do I access (like does it work like a dynamic variable ??) and send it to the API ?
s
oh!! you want to make an API call w/o tool, sorry I am getting confused here.
please make me understand, what outcome you expected to get and what otucome you actually got instead?
r
So, I have this API which is capable of tracking API metrics (requests, duration of each requests, url of the endpoint, status code of the request, method of the endpoint, etc) so all I want to do is track these metrics from the Vapi assistant
So I use this API to charge my clients per request the AI APIs make, I don't charge upfront
@Shubham Bajaj got it bro ?
s
Hey @Richard you have to use server events as of now apart from custom-tools-callling we don't any other webhook calls.
r
Alright
s
Hey @Richard can i close this ticket?
r
sure bro, go ahead. If I am facing some issue then I will just DM if that's ok with you
5 Views