Function Problem
# support
k
When I try to get prospect's phone number and send it to the webhook, It does not work. Even if I put "{phone_number}" or "{{phone_number}}" It does not read it What am I doing wrong?
v
Hi @kozakoZ, 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 Phone Call]() * [Glossary]() * [Server URLs]() * [List Calls]() -----------------------------
### Answer It looks like you might be encountering an issue related to how parameters are named and passed in the webhook payload. According to the Vapi documentation, parameters need to be formatted correctly when sending to the webhook. 1. Ensure that you have registered the correct server URL to receive the webhook events from Vapi [(1)]() . 2. When defining the parameters in your assistant, make sure they match the expected format in the webhook. For example, if the webhook expects
phone_number
, use
phone_number
without curly braces. 3. If you are experiencing issues with parameter names being sent in the wrong format, like "start_time" vs. "startTime", this could be due to model hallucination. A possible solution is to handle both formats within your webhook [(2)]() . Here is an example of how to define and send the payload correctly in cURL:
Copy code
shell
curl --request POST \
--url https://api.vapi.ai/call/phone \
--header 'Authorization: Bearer <your_token>' \
--header 'Content-Type: application/json' \
--data '{
  "customer": {
    "number": "your_phone_number"
  },
  "phoneNumber": {
    "twilioPhoneNumber": "your_twilio_number"
  },
  "assistantId": "your_assistant_id",
  "serverUrl": "your_server_url",
  "metadata": {
    "phone_number": "1234567890"
  }
}'
[(1)]() , [(2)]() Make sure the
serverUrl
is correctly set up to receive and handle the incoming data. If you continue to experience issues, double-check the webhook logs to see if the payload is being received and processed as expected.
Got it. Tagging @User for additional help.
s
Are you providing the value in { "variableValues" : {your variable object}}?
k
What do I do?
s
Send me a loom video showcasing all the things that you are doing and what you need to do so that i can point to the right direction.