#While submitting a batch job via API, is it possible to include dynamic variables like in the UI vi
1 messages · Page 1 of 1 (latest)
Yes, when submitting a batch job via API, you can include dynamic variables for each recipient in the dynamic_variables object within the JSON payload. This allows you to pass personalized data for each recipient, similar to how you would use dynamic variables in the UI via a CSV file.
Here’s an example of how the JSON payload should look:
{
"call_name": "Batch Call",
"agent_id": "agent_xxx",
"agent_phone_number_id": "phnum_xxxx",
"scheduled_time_unix": 0,
"recipients": [
{
"phone_number": "+xxxx",
"dynamic_variables": {
"name": "Matthias"
}
}
]
}
Make sure:
- The variable names in the
dynamic_variablesobject match exactly (case-sensitive) with the placeholders in your first message template. - There are no extra spaces or special characters in the variable names.
- The first message template uses double curly braces for placeholders, e.g.,
{{name}}.
If you’re encountering issues, double-check the formatting of both the JSON payload and the first message template to ensure consistency.
This doesn't work
Could you clarify what specifically isn't working for you? If you're encountering an issue, providing more details about the problem will help me assist you better. For example, are you having trouble with a specific feature, a technical error, or something else? Let me know!
Yeah the dynamic variables are not being processed by the API this way