HTTP request returns err msg:
Problem in node ‘HTTP Request‘
JSON parameter need to be an valid JSON
using json below:
{
"token": "{{ $json["token"] }}",
"idMassa": "{{ $json["idMassa"] }}",
"priority": {{ $json["priority"] }},
"interval": {{ $json["interval"] }},
"emailMsg": "{{ $json["emailMsg"] }}",
"emailSubject": "{{ $json["emailSubject"] }}",
"emails": [{{ $json['emails'] }}],
"SMTP": {
"nome": "{{ $json["SMTP"]["nome"] }}",
"email": "{{ $json["SMTP"]["email"] }}",
"user": "{{ $json["SMTP"]["user"] }}",
"pwd": "{{ $json["SMTP"]["pwd"] }}",
"smtp": "{{ $json["SMTP"]["smtp"] }}",
"port": {{ $json["SMTP"]["port"] }},
"encryption": "{{ $json["SMTP"]["encryption"] }}",
"auth": "{{ $json["SMTP"]["auth"] }}",
"emailReply": "{{ $json["SMTP"]["emailReply"] }}"
}
}
The problem is here:
"emails": [{{ $json['emails'] }}],
If I change the json as below works fine!
{
"token": "{{ $json["token"] }}",
"idMassa": "{{ $json["idMassa"] }}",
"priority": {{ $json["priority"] }},
"interval": {{ $json["interval"] }},
"emailMsg": "{{ $json["emailMsg"] }}",
"emailSubject": "{{ $json["emailSubject"] }}",
"emails": [{"email": "[email protected]", "variables": {"nome1": "Lucas"}}],
"SMTP": {
"nome": "{{ $json["SMTP"]["nome"] }}",
"email": "{{ $json["SMTP"]["email"] }}",
"user": "{{ $json["SMTP"]["user"] }}",
"pwd": "{{ $json["SMTP"]["pwd"] }}",
"smtp": "{{ $json["SMTP"]["smtp"] }}",
"port": {{ $json["SMTP"]["port"] }},
"encryption": "{{ $json["SMTP"]["encryption"] }}",
"auth": "{{ $json["SMTP"]["auth"] }}",
"emailReply": "{{ $json["SMTP"]["emailReply"] }}"
}
}
The Json above is the same. I just pasted the contents of {{ $json[‘emails’] }} from the json result itself.
What is happening?
- n8n version: 1.53.2
- Running n8n via (Docker, npm, n8n cloud, desktop app): npm
- Operating system: Debian 12