

I am making an API to Carbone (PDF generator site) to generate a PDF based on JSON data that I provide. This is all being done through Retool which uses JavaScript and is an app building application.
I have a JSON string saved as a variable:
jsonString = '{
"products": [{"name": "Fred"},
{"name": "Abby"},
{"name": "Jason"},
{"name": "Josh"}]
}'
This is a string variable.
When I hardcode this into the API call data parameter, the PDF returns just fine. However, when I input this variable into the call, the PDF does not generate at all.
Am I missing something? I have already tried deleting the first and last character of the string in case for some reason quotes were being added to the variable but it did not fix anything.
{
"products": [{"name": "Fred"},
{"name": "Abby"},
{"name": "Jason"},
{"name": "Josh"}]
}
^ This is the hardcoded value I can enter in the data parameter for the API call and it works.