I need the agent to read the webhook response
# support
j
How do I prompt the agent to read the value received from the webhook response? I checked the webhook response in the wbhook logs and its recieving the right output from make.com. I've tried "result" and "message" as well as prompting the agent to read them. I'm stuck if anyone could help I'd greatly appreciate it.
v
Hi there! πŸ‘‹ I understand you're having trouble getting your agent to read values from your webhook response. Let me help with that! I can't provide specific code tailored to your exact webhook structure, but I can definitely help with general guidance on how to properly format and access webhook response values in Vapi. According to the [documentation](https://docs.vapi.ai/tools/custom-tools), webhook responses in Vapi need to follow a specific format:
Copy code
json
{
    "results": [
        {
            "toolCallId": "X",
            "result": "Y"
        }
    ]
}
Here are some key points to check: 1. **Correct Response Format**: Make sure your webhook response strictly follows the format above. The
toolCallId
in your response must match the ID that was sent by Vapi in the initial request. 2. **Content-Type Header**: Ensure the
Content-Type
header of your webhook response is set to
application/json
. 3. **Check Webhook Logs**: When examining your webhook logs, look for: - The exact structure of the response - Any error messages - Whether the
toolCallId
matches between request and response 4. **Common Issues to Check**: - Incorrect JSON formatting - Missing or mismatched
toolCallId
- Data serialization problems - String formatting issues (ensure proper use of quotes) 5. **Troubleshooting Steps**: - Use a tool like [jsonlint.com](https://jsonlint.com/) to validate your JSON - Test your webhook manually using Postman or cURL - Implement logging on both sending and receiving ends - Check for any casing inconsistencies (snake_case vs. camelCase) If you're still having trouble, could you share more details about the exact structure of your webhook response from make.com? That would help me provide more specific guidance. Sources: - [Webhook Response Structure](https://docs.vapi.ai/tools/custom-tools)
v
Message marked as helpful by @James! πŸŽ‰
Message marked as helpful by @James! πŸŽ‰
j
@Vapi Support Bot in my webhook response body in make.com do i put the tool id manually from the tool that is being called?
v
Hi James! πŸ‘‹ I understand you're wondering about the tool ID in your webhook response body in make.com. While I don't have specific information about make.com's implementation details, I can definitely help with how the toolCallId should be handled in Vapi webhook responses. According to the [documentation](https://docs.vapi.ai/tools/custom-tools), the toolCallId in your webhook response must match the ID that was sent by Vapi in the initial request. This means you shouldn't manually create a random ID - you need to use the exact same toolCallId that Vapi sent to your webhook. The correct format for the webhook response is:
Copy code
json
{
    "results": [
        {
            "toolCallId": "X",
            "result": "Y"
        }
    ]
}
Where "X" should be the exact toolCallId from the original request. If the IDs don't match, Vapi won't be able to associate your response with the correct tool call. In make.com, you would need to extract the toolCallId from the incoming webhook request and then include that same ID in your response. This is typically done by parsing the incoming JSON and then using that parsed value in your response template. Is there anything else you'd like to know about handling webhook responses in Vapi? Sources: - [Webhook Response Structure](https://docs.vapi.ai/tools/custom-tools) - [Webhook Response Format](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339900285727805513) - [Troubleshooting Webhook Issues](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1330221332452999321)
k
checking if this is resolved/solved for you?
j
i haven’t been home so i cant try yet but 1. do i input the tool id manually into my webhook response body in make 2. for the result: do i just input what i want to be said 3. what do i prompt the agent in vapi so it says the result @User
v
Message marked as helpful by @James! πŸŽ‰
3 Views