dynamically setting the serverUrl
# support
c
1. I can reliably get a hardcoded serverUrl working with an assistant. 2. I can trigger calls with an "undefined" assistant where all the details are provided in the API request to CreatePhoneCall. 2a. I can not get those "undefined" assistants to send events to a provided serverUrl. 2b. Using the same serverUrl with an assistant works just fine, so I know there's some break in expectations here. What's confusing is that the response from createPhoneCall includes the serverUrl, but then sends nothing back. Any thoughts on this? I have a workaround, but want to confirm there's not an easy fix before I put the time in (and have to refactor schemas)
v
Hi @Charles, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Create Assistant]() * [Update Assistant]() * [Get Assistant]() * [List Phone Numbers]() -----------------------------
### Answer It sounds like you're experiencing a discrepancy in the behavior of dynamically versus statically set server URLs with Vapi's assistants. The issue you described where the server URL appears correct in the response from
CreatePhoneCall
but does not trigger events as expected suggests a potential issue with how the server URL is being handled dynamically. Based on the provided documentation, when creating or updating an assistant, you can specify a
serverUrl
which should dynamically direct the API where to send event information. If this URL is not being recognized when set during the phone call creation, it's possible that there might be a bug or a specific requirement or condition that is not being met in the API. As a workaround, you mentioned that using a hardcoded server URL works. To ensure there's not a simple oversight: 1. Double-check that the server URL provided dynamically matches exactly the URL that works when hardcoded. 2. Ensure that the server URL is correctly formatted and accessible by Vapi at the time of the call. For further diagnostics, you might consider capturing the API requests and responses using tools like Postman or a similar API testing tool to see what differences, if any, there might be in the requests sent by Vapi when the server URL is set dynamically versus statically. Unfortunately, without more specific documentation or error logs from the API calls, it's challenging to provide a more precise solution. At this point, if the issue persists, reviewing the detailed API request and response data or reaching out to Vapi's technical support might be necessary steps.
Got it. Tagging @User for additional help.
c
I've copied the serverUrl from the CreatePhoneCall response into a static assistant and it works. So just want confimration on the API usage
s
Can you send me a loom video probably?