Describe the problem/error/question
I am trying to dynamically reference an input in my HTTP request node. I would like to send a custom HTTP request to Wordpress to publish a blog post automatically. I have manually inputted the following JSON and the post was successfully created on my word press site:
JSON (Expression):
{
“title”: “THIS IS A TEST FOR A FORUM”,
“content”: “Hello thank you for looking into this problem for me”,
“status”: “publish”
}
Wordpress output:
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
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
JSON:
{{
{
“title”: “$(‘Edit Fields1’).first().json[‘Title’]”,
“content”: “$json[‘blogPost’]”,
“status”: “publish”
}
}}
What is the error message (if any)?
The error I get is JSON parameter needs to be valid JSON.
Please share your workflow
The Entire WorkFlow for reference:
Information on your n8n setup
- n8n version: 1.76.1
- Database (default: SQLite): IDK what this means but I am using Airtable
- n8n EXECUTIONS_PROCESS setting (default: own, main): i think default but idk what this means
- Running n8n via (Docker, npm, n8n cloud, desktop app): running it via docker container on a vps.
- Operating system: VPS is linux