Calling VAPI from Twilio Studio Flow
# support
c
Hello. I'm trying to call https://api.vapi.ai/twilio/inbound_call from one the "Make Http Request" Twilio widgets inside Studio Flow. I'm not sure what should i use as body params, i've tried some twilio params like {{trigger}}, {{trigger.call}}, etc but i always get a http 400 error. Last try returned "Expected property name or '}' in JSON at position 1 (line 1 column 2)"
v
Your error suggests a JSON formatting issue. When using the "Make Http Request" widget, ensure you're sending properly formatted JSON with the Content-Type header set to
application/json
. Try this format:
Copy code
json
{
  "CallSid": "{{trigger.call.CallSid}}",
  "Caller": "{{trigger.call.From}}",
  "CallStatus": "ringing"
}
The VAPI endpoint expects specific parameters, and
CallStatus
must be "ringing" to avoid a 400 error. Sources: - [Discord discussion about VAPI endpoint parameters](https://discord.com/channels/1211482211119796234/1342459464346767492) - [Discord discussion about JSON payload structure](https://discord.com/channels/1211482211119796234/1343574701909344297)
v
Message marked as helpful by @ChaloVega! 🎉
c
it worked by dissecting {{trigger.call}} and following the bot example but with all fields. But now i'm facing another error: "vapiCall": { "status_code": 201, "content_type": "text/html", "body": "\n \n \n \n \n \n " }
hmm i think this is not vapi's problem. I assume i have to do something with this response inside Studio Flow but i'm not sure what.
s
Can you rephrase your ticket description and steps taken to resolve it, I couldn't understand what your trying to achieve. This will help me understand your challenges and tailor suggestions. I can propose new solutions or enhance existing approaches. 
c
@Shubham Bajaj is the api documentation for calling https://api.vapi.ai/twilio/inbound_call available? let me solve this and then i'll rephrase the question
s
No, we do not have any documentation on this URL. This is used for accepting incoming calls to VAPI assistants. You do not have to manually set it unless you want to use advanced phone call bypass. If that is the case, here is the documentation link for it. If not, simply import the number to VAPI, and we will take care of it.
3 Views