ltd-scarletL
VAPI2mo ago
ltd-scarlet

How to send application/x-www-form-urlencoded with Function/API Request Tools?

Hi VAPI team,

I'm trying to integrate Twilio Verify API which requires application/x-www-form-urlencoded format for POST requests, but I'm having trouble with VAPI tools.

WHAT I NEED TO SEND:
POST https://verify.twilio.com/v2/Services/{ServiceSid}/Verifications
Content-Type: application/x-www-form-urlencoded
Body: To=+13417668501&Channel=sms

WHAT I'VE TRIED:

  1. API Request Tool:
    • Set Content-Type header to application/x-www-form-urlencoded
    • Configured body properties (To, Channel)
    • Result: Twilio returns error 20001 "Missing required parameters"
    • The body data isn't being sent
  2. Found this Discord thread saying API Request tools are hardcoded to JSON:https://discord.com/channels/.../API-Request-Tool-adds-default-Content-TypeKyle mentioned "function tool will allow you to customize the header"
  3. Function Tool:
    • Added Content-Type: application/x-www-form-urlencoded header
    • Configured parameters (To, Channel)
    • Result: "No result returned" error
    • Seems Function Tools expect to call my server, not external APIs?
QUESTIONS:
  1. Is it possible to send form-encoded POST requests directly to external APIs with VAPI tools?
  2. If yes, what's the correct configuration?
  3. If no, do I need to create a backend proxy that reformats the request?
The API works perfectly in Postman with form-encoded data, just can't figure out how to make VAPI send that format.

Any guidance would be greatly appreciated!
Discord
Discord is great for playing games and chilling with friends, or even building a worldwide community. Customize your own space to talk, play, and hang out.
Was this page helpful?