JSON parameter needs to be valid JSON error (Mailerlite)

Heya, I have been excited to work with n8n, but I have a bit of trouble with the HTTP node. For context, I am trying to send a HTTP post request to the Mailerlite API to create a Mailerlite Campaign. I suspect that there is something wrong with my resolved JSON, because it is catching an error on the n8n side. When I ran it through a JSON validator, it pointed out errors on the HTML line. This is most likely a skill issue on my part, but I would greatly appreciate any direction. If you need more context, feel free to ask.

Hey @Astroartificer !

You have everywhere in the json output double quotes and other characters and is breaking the json…

You can try use JSON.stringify and see if it works…

“html”: “{{ JSON.stringify($json.emails[0].content.html }}”

Cheers!

1 Like

That ended up working! I have a different error now, but I appreciate it. Thank you!