GorgeousPuree
03/30/2025, 7:04 PMVapi Support Bot
03/30/2025, 7:06 PM{{customer.number}}
variable in your API node body. While I can't pinpoint the exact cause of the empty string you're receiving, I can definitely help with how to correctly pass this variable.
Here's how to correctly pass the {{customer.number}}
variable in the API node body:
## Correct Format and Syntax
The {{customer.number}}
is indeed a default dynamic variable in Vapi that represents the customer's phone number. It should be in E.164 format (e.g., +14155551234) with the + prefix [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342514332604432424).
## Passing the Variable Correctly
There are a few approaches to ensure the variable is passed correctly:
1. **Using assistantOverrides
with `variableValues`**:
json
{
"assistantId": "your-assistant-id",
"assistantOverrides": {
"variableValues": {
"customer.number": "+1xxxxxxxxxx"
}
},
"customer": {
"number": "+1xxxxxxxxxx"
},
"phoneNumberId": "your-phone-id"
}
[Source](https://docs.vapi.ai/assistants/dynamic-variables)
2. **Setting the customer field when creating a call**:
javascript
const call = await vapiClient.calls.create({
phoneNumberId: "your-phone-number-id",
customer: {
number: "+1234567890", // Customer's phone number
name: "John Doe", // Optional customer name
metadata: {} // Optional metadata about the customer
},
assistant: {
// Your assistant configuration
}
});
[Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341835905656291369)
## Troubleshooting Steps
If you're still receiving an empty string, try these troubleshooting steps:Vapi Support Bot
03/30/2025, 7:06 PMcustomer.number
variable is available at the time the prompt is being generated [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336772166330351646).
2. **Verify syntax**: Double-check that the dynamic variable is correctly named and that the syntax matches the documentation [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336772166330351646).
3. **Check execution order**: Make sure that the block which sets the variable is executed before the block that needs to use it [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1315677399026765855).
4. **Verify format**: Confirm that the format of {{customer.number}}
matches what VAPI expects (E.164 format) [Source](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1325856450391834817).
Is there any additional information you can share about your setup that might help me provide more specific guidance?
Sources:
- [Discord Thread about customer.number format](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342514332604432424)
- [Vapi Documentation on Dynamic Variables](https://docs.vapi.ai/assistants/dynamic-variables)
- [Discord Thread about creating calls with customer information](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341835905656291369)
- [Discord Thread about variable availability](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1336772166330351646)
- [Discord Thread about execution order](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1315677399026765855)
- [Discord Thread about troubleshooting variable passing](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1325856450391834817)GorgeousPuree
03/30/2025, 7:17 PMGorgeousPuree
03/30/2025, 7:29 PMAditya
03/31/2025, 9:29 AMGorgeousPuree
03/31/2025, 10:32 AMGorgeousPuree
03/31/2025, 10:32 AMAditya
03/31/2025, 3:45 PMAditya
03/31/2025, 3:47 PMGorgeousPuree
03/31/2025, 4:07 PMGorgeousPuree
03/31/2025, 4:09 PMAditya
03/31/2025, 10:14 PMGorgeousPuree
04/01/2025, 10:40 AMAditya
04/01/2025, 3:18 PM{{now}}
)
2\. The request is sent to your endpoint (\`)
3\. However, the response from the endpoint is a plain text error ("Error in workflow") rather than valid JSON
4\. The workflow expects a JSON response and fails when trying to parse the text response
The error occurs in the ApiRequestStream
class when trying to parse the response with response.json()
, which expects valid JSON but receives text instead.
To fix this:
1\. Make sure your API endpoint returns valid JSON responses, even for errors
2\. Alternatively, configure your API endpoint to handle the format being sent correctly
3\. Check your pipedream webhook configuration to ensure it's expecting the correct format
If you want to test if variables are being correctly substituted:
1\. Set up a simple echo API endpoint that returns the received request body as JSON
2\. This will let you confirm the variables are being correctly interpolatedAditya
04/01/2025, 3:18 PMGorgeousPuree
04/02/2025, 8:53 PMAditya
04/06/2025, 12:38 PMGorgeousPuree
04/14/2025, 7:33 AMKings_big💫
04/14/2025, 9:04 AMGorgeousPuree
04/15/2025, 9:54 AMKings_big💫
04/15/2025, 10:50 AMGorgeousPuree
04/17/2025, 5:08 AMGorgeousPuree
04/21/2025, 8:46 AMKings_big💫
04/21/2025, 8:56 AM{{now}}
, {{customer.number}}
) aren't resolving, verify the correct variable names, test with hardcoded values first, and ensure the API node is placed after the data is generated in your workflow. The backend error is likely separate from the empty parameter issue.