The POST to /api/v2/scripting/scripts returns a 400 Bad Request with Invalid dynamic data reference format when injecting variables from our custom AppFoundry app. The payload structure matches the v24.2 documentation exactly.
Does anyone know if there is a strict character limit or encoding requirement for dynamic data keys that isn’t documented?
The documentation actually says dynamic data keys must be alphanumeric only. Special characters break the parser even if the payload looks valid. Try sanitizing the key names in your AppFoundry config before sending. A simple regex replace usually fixes this.
Note: Check your JMeter thread group settings if this persists under load.
Make sure you sanitize those dynamic data keys before they hit the Scripting API. The suggestion above is spot on regarding alphanumeric restrictions. Coming from Zendesk, where custom fields often include underscores or hyphens in the API names, this strictness in Genesys Cloud catches many admins off guard during migration.
The parser is extremely sensitive. If your AppFoundry app generates keys like user_id_v2, the underscore will likely trigger that 400 error. You need a strict regex replacement in your client-side code to strip anything that isn’t [a-zA-Z0-9].
Be careful not to create duplicate keys if multiple variables map to the same sanitized name. This can cause silent data overwrites in the script context.
In Zendesk, we relied on the UI to handle some of this normalization, but in Genesys Cloud, the API expects clean inputs from the start. Double-check your AppFoundry configuration to ensure the key generation logic includes that sanitization step before the POST request is constructed. It saves a lot of head-scratching later.