I’m currently facing an issue while attempting to send a PUT HTTP request to an API with a JSON body in n8n. The JSON body is expected to include an array of IDs, and each ID should contain in special characters in the form of “”. However, when I preview the JSON expression, the array appears with the special characters, but the actual JSON sent in the request does not include them.
Have you checked that the data being sent doesn’t include them? It might be worth posting your data to webhook.site to see what arrives as without the " the json array would be invalid so I would be surprised if we were sending it without.
The input from the previous node is an array of IDs, and I’m attempting to configure the JSON body of the HTTP request.
However, I’m encountering the following error: “ERROR: JSON parameter needs to be a valid JSON.” The expression of the JSON body is configured based on the array of IDs. I’ve attached images to provide a visual representation of my configuration.
Thank you for your prompt response and suggestion. I’ve made the change as you recommended, updating from $('get_line_data').first().json["ids"] to $('get_line_data').first().json.ids. However, the error “ERROR: JSON parameter needs to be a valid JSON” persists.