adverse-sapphire
adverse-sapphire7h ago

Parameters derived from properties in APIRequest tool not working correctly

I created properties in the request body and tried to use them as parameters in the api url field and the url shows up fine in the preview but when I execute the test, it messes up the url.
No description
No description
No description
3 Replies
Vapi Support Bot
Suggestion:
To ensure your URL parameters like {{start}}, {{end}}, and {{timezone}} are substituted correctly, define them as top-level parameters in your tool configuration, not just in the request body. For example:
{
"parameters": {
"start": { "type": "string", "description": "Start time" },
"end": { "type": "string", "description": "End time" },
"timezone": { "type": "string", "description": "Time zone" }
},
"url": "https://api.cal.com/v2/slots?eventTypeSlug=consultation&username=sailboatai&start={{start}}&end={{end}}&timeZone={{timezone}}"
}
{
"parameters": {
"start": { "type": "string", "description": "Start time" },
"end": { "type": "string", "description": "End time" },
"timezone": { "type": "string", "description": "Time zone" }
},
"url": "https://api.cal.com/v2/slots?eventTypeSlug=consultation&username=sailboatai&start={{start}}&end={{end}}&timeZone={{timezone}}"
}
Update your tool config to include these parameters at the top level, then test again.
For more, see the custom tools guide. Source: - Custom Tools
⤵️ Mention @Vapi Support Bot for follow-ups 🐥
adverse-sapphire
adverse-sapphireOP7h ago
It seems like this is a configuration for a custom tool when I am trying to work with the api request tool. Should I be using the custom tool? Also I need to make a GET request so am I able to do that with the custom tool?
conscious-sapphire
conscious-sapphire6h ago
I can help you sort this out so your variables work properly when the request runs. This usually happens because the API request tool doesn’t handle dynamic values well, while the custom tool does. You can still make GET requests there without any issue. Could you show me how you set up the variables in your request body? @Ovi1kanobe

Did you find this page helpful?