What is your goal?
Score LinkedIn comments with the Anthropic Claude “Make an API Call” module by inserting each comment into the JSON request body, then save results to Google Sheets.
What is the problem & what have you tried?
In the Anthropic “Make an API Call” module, my Body is raw JSON and I inject a variable comment into the content field: “content”: “{{11.cleanComment}}”. The comment contains line breaks and double-quotes, which break the JSON. I tried toJSON() but my Make says “Function ‘toJSON’ not found.” I also tried nesting replace() to strip newlines and quotes, but I still get JSON errors. What’s the correct way to escape a text variable so the JSON body stays valid?
Error messages or input/output bundles
[400] The request body is not valid JSON: unexpected character: line 8 column 56 (char 1025)
Code: RuntimeError
Origin: Anthropic Claude