What response should the server send back for tool...
# support
a
Had a quick question, I have a make app that checks if a date is booked and if so it has to return back to VAPI that the date is booked and choose another. Not sure how to send this message back to VAPI from MAKE any ideas? Here is what I am trying but i dont think it works, Thanks so much! https://cdn.discordapp.com/attachments/1265813569036095641/1265813569300205729/Screenshot_2024-07-24_at_5.28.48_PM.png?ex=66a2e040&is=66a18ec0&hm=f5348de32bb687ba202d9186f72d92fc44cdc152fe8b97a4dd0746ea8ee61298&
v
@AiTitus :) Certainly! To send a message back to VAPI from MAKE indicating that a date is booked, you would typically use a webhook or an API call from MAKE to VAPI. Here's a general idea of how you can do it: 1. Set up a webhook in VAPI that listens for incoming messages. 2. In your MAKE scenario, after checking if the date is booked, use an HTTP module to make a POST request to the VAPI webhook URL. 3. Include the message that the date is booked and a prompt to choose another date in the body of the POST request. Here's a pseudo-code example of what the HTTP request from MAKE might look like:
Copy code
json
{
  "method": "POST",
  "url": "https://your-vapi-webhook-url",
  "body": {
    "type": "add-message",
    "message": {
      "role": "system",
      "content": "The selected date is already booked. Please choose another date."
    }
  }
}
Make sure to replace
https://your-vapi-webhook-url
with the actual URL provided by VAPI for the webhook. If you need assistance setting up the webhook in VAPI or configuring the HTTP request in MAKE, please let me know, and I'll be happy to help further!
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
a
How do I setup the webhook in VAPI? Also isnt there a way to just return a fail message from the tool so VAPI gets that? @User
do i also need some sort of session id etc so tha VAPI knows what the message is about?
but its a bit confusing could you put together a quick example of a successful exectuion of the tool and a failed execution of the tool as well as a clarificaton or return for more details from the tool? Thanks so muhc @User
s
Copy code
json
{
    "results": [
        {
            "toolCallId": "X",
            "error": "Y"
        }
    ]
}
return the response as error it will indicate that tool call was failure.
let me how it goes.
4 Views