I’m setting up an HTTP Request node in n8n to automatically publish blog posts to my WordPress site. When I manually input the JSON payload, the post is created successfully:
{
“title”: “THIS IS A TEST FOR A FORUM”,
“content”: “Hello thank you for looking into this problem for me”,
“status”: “publish”
}
However, when I try to use dynamic expressions to reference data from prior nodes, I get the error “JSON parameter needs to be valid JSON”. Here are my HTTP parameters:
Method: Post
URL: https://protexlawn.com/wp-json/wp/v2/posts
Authentication: None
Send Query Parameters: Off
Send Headers: On
Specify Headers: Using JSON
{
“Authorization”: “Basic My access key that I am confident I shouldn’t type here despite being a complete coding noob”,
“Content-Type”: “application/json”
}
Send Body: On
Body Content Type: JSON
Specify Body: Using JSON
{{
{
“title”: “$(‘Edit Fields1’).first().json[‘Title’]”,
“content”: “$json[‘blogPost’]”,
“status”: “publish”
}
}}
I’m using n8n version 1.76.1 on a Linux VPS (via Docker) with Airtable for the database. I suspect that the error might be due to the use of non-standard curly quotes, extra outer braces, or incorrect expression syntax. I’d like to know how to format the JSON payload correctly so that n8n accepts it as valid JSON while still allowing dynamic references from previous nodes.
Any help or insights would be greatly appreciated.