What is your goal?
Process incoming webhook data and generate a PDF via APITemplate.io,
including a multi-line text field (“informe” / report) in the PDF.
What is the problem & what have you tried?
My scenario is: Webhook → Google Sheets → Tools → APITemplate.io
The last module (APITemplate.io) fails with this error:
[400] Invalid JSON data: SyntaxError: Bad control character in string
literal in JSON at position 506 (line 16 column 77)
Code: RuntimeError
The problem is that one of my incoming webhook fields (“informe”)
contains actual line breaks (multi-paragraph text). This breaks the
JSON body that Make sends to APITemplate.
My Payload Type is set to “Dynamic Data (JSON Payload)”.
I tried wrapping the variable inside the JSON field like:
“informe”: “{{replace(1.informe; newline; “\n”)}}”
but I’m not sure if this is the correct syntax.
Question: what’s the correct way to escape line breaks inside the
JSON body without switching to Key Value Pairs? What’s the exact
syntax for the replace() function inside a JSON field?
Thanks!
Error messages or input/output bundles
[400] Invalid JSON data: SyntaxError: Bad control character in string literal in JSON at position 506 (line 16 column 77)
Code: RuntimeError