#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)

honest vectorBOT
#
AI-generated Answer for erikeros.ev

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:

  1. The variable names in the dynamic_variables object match exactly (case-sensitive) with the placeholders in your first message template.
  2. There are no extra spaces or special characters in the variable names.
  3. 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.

wind marsh
#

This doesn't work

honest vectorBOT
#
AI-generated Answer for erikeros.ev

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!

wind marsh
#

Yeah the dynamic variables are not being processed by the API this way