Answer to webhook
# support
b
I have created a function that runs correctly and everything goes as it should. But the problem is when the Answer to webhook module sends the answer to vapi. I send json, but the assistant doesn't respond to what I send... { "results": [ { "toolCallId": "1. message.toolCalls[].id", "result": "All right, buddy." } ] } Anyone got any ideas?
v
message has been deleted
You can continue this conversation by mentioning me in the message.
@Benda It seems like you're on the right track with the JSON response format. However, the value for "toolCallId" should be the actual ID received from the webhook, not a placeholder or string that looks like a reference to the ID. Make sure that you are extracting the
toolCallId
from the incoming webhook request and using that exact ID in your response. Here's a quick checklist to ensure your response is correctly formatted: 1. Confirm that the
toolCallId
in your response matches the
toolCallId
that was sent to your server by VAPI. 2. Ensure that the
result
field contains the response you want the assistant to speak or act upon. 3. Verify that your server is sending the response back with the correct
Content-Type
header, which should be
application/json
. 4. Check that your server is responding within the expected time frame, as delays can cause timeouts. If you've checked all these points and the issue persists, please provide more details or ask support for more info on this.
b
yes, I think I have everything set up correctly...
s
Hey @Benda can you share the call id?
b
Hello, thank you for your time. I'm desperate; I've been trying for three weeks to figure out why this isn't working. I created a simple function to test the webhook, and it works—the assistant repeats what it's supposed to. When I use Postman, the expected response is returned, as set in the webhook reply, but this assistant doesn't repeat what the webhook returns. I'm really at a loss... Here are the IDs: call_RxXQ2TPbJ7xhobYlBX0djPPE - call_DVeLxV5xNusIJLbFLPRCsRnr - call_5sdDIaNjyWVrTfzQxLAaD0NC
s
Hey @Benda these are not the call ids, these are tool ids. A call id is a unique id assigned to each call which you can find in dashboard by visiting to logs page.
b
I'm sorry. Here are the IDs: afdc6163-a1a2-4b6a-8731-0f7b8a721fd9 b9cee9dd-e335-475f-a6d4-b98fd7ac4744 4bc60285-ad94-4cd7-8a9a-7099118f8005 011e7931-8833-45be-993a-f4983d68e66b
s
Hey @Benda it's answering to your response please check the logs.
Copy code
json
🔵 04:56:42:126 AzureOpenAIRequest. Messages:
[
  {
    "role": "system",
    "content": "Role:\nJste zkušená AI asistentka pro Autoservis Ji..."
  },
  {
    "role": "assistant",
    "content": "Dobrý den, vítejte v Autoservisu jiskra jak vám můžeme dnes pomoci?"
  },
  {
    "role": "user",
    "content": "Dobrý den, což se objednat vyjmenholie"
  },
  {
    "role": "assistant",
    "content": "Ano, tuto službu poskytujeme. Mohu vám položit pár otázek abychom naplánovali návštěvu?"
  },
  {"role": "user", "content": "Ano, určitě vítejte."},
  {
    "role": "assistant",
    "content": "Dobře, jaké je vaše příjmení?"
  },
  {"role": "user", "content": "Benda,"},
  {
    "role": "assistant",
    "content": "Děkuji, pane Benda, jaká je značka vašeho vozidla?"
  },
  {"role": "user", "content": "Škoda."},
  {
    "role": "assistant",
    "content": "Skvělélé a kdy vám vyhovuje k nám přistavit vozidlo?"
  },
  {"role": "user", "content": "Zítra v 10."},
  {
    "role": "assistant",
    "content": "undefined\n\nTo zabere jenom vteřinu.",
    "toolCalls": [
      {
        "id": "call_ov1nQFiogw8GQWotiG844tw0",
        "type": "function",
        "function": {
          "name": "Rezervace",
          "arguments": "{\"čas\": \"zítra v 10\"}"
        }
      }
    ]
  },
  {
    "role": "tool",
    "content": "Ty kokot, funguje to",
    "toolCallId": "call_ov1nQFiogw8GQWotiG844tw0"
  }
]
7 Views