ema
05/15/2024, 8:23 AMVapi Support
05/15/2024, 8:23 AMVapi Support
05/15/2024, 8:23 AMjson
{
"result": "Your function result here"
}
If the result is more complex, it can be an object:
json
{
"result": {
"message": "Your function result here",
"extraData": "Additional data if needed"
}
}
Here is a breakdown of the steps:
1. Receive the POST request at your server URL with the function call details.
2. Process the request and perform the necessary actions.
3. Respond with a JSON object containing the result.
For example, if Vapi sends a function call like this:
json
{
"message": {
"type": "function-call",
"call": { /* Call Object */ },
"functionCall": {
"name": "sendEmail",
"parameters": "{ \"emailAddress\": \"john@example.com\" }"
}
}
}
Your server should respond with:
json
{
"result": "Your email has been sent."
}
Or for a more detailed response:
json
{
"result": {
"message": "Your email has been sent.",
"email": "john@example.com"
}
}
This response will then be used by Vapi to continue the conversation or perform further actions as necessary [(1)]() .
: [Server Events]()