# Body json problem in HTTTP request

**URL:** <https://community.n8n.io/t/body-json-problem-in-htttp-request/51618>\
**Category:** Questions\
**Created:** [August 11, 2024, 7:49pm UTC](https://community.n8n.io/t/body-json-problem-in-htttp-request/51618 "2024-08-11T19:49:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lecio\_L](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/lecio_l/32/42829_2.png) [@Lecio\_L](https://community.n8n.io/u/Lecio_L)\
**Post date:** [August 11, 2024, 7:49pm UTC](https://community.n8n.io/t/body-json-problem-in-htttp-request/51618/1 "2024-08-11T19:49:51Z")

</div>

HTTP request returns err msg:

```auto
Problem in node ‘HTTP Request‘
JSON parameter need to be an valid JSON

```

using json below:

```auto
{
  "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:

```auto
"emails": [{{ $json['emails'] }}],

```

If I change the json as below works fine!

```auto
{
  "token": "{{ $json["token"] }}",
  "idMassa": "{{ $json["idMassa"] }}",
  "priority": {{ $json["priority"] }},
  "interval": {{ $json["interval"] }},
  "emailMsg": "{{ $json["emailMsg"] }}",
  "emailSubject": "{{ $json["emailSubject"] }}",
  "emails": [{"email": "email@xxx.org", "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**

---

<div class="post-metadata">

**Author:** ![n8n](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/n8n/32/196425_2.png) [@n8n](https://community.n8n.io/u/n8n)\
**Post date:** [August 11, 2024, 7:49pm UTC](https://community.n8n.io/t/body-json-problem-in-htttp-request/51618/2 "2024-08-11T19:49:52Z")

</div>

It looks like your topic is missing some important information. Could you provide the following if applicable.

- **n8n version:**
- **Database (default: SQLite):**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):**
- **Operating system:**

---

<div class="post-metadata">

**Author:** ![ihortom](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ihortom/32/11473_2.png) [@ihortom](https://community.n8n.io/u/ihortom)\
**Post date:** [August 11, 2024, 8:07pm UTC](https://community.n8n.io/t/body-json-problem-in-htttp-request/51618/3 "2024-08-11T20:07:49Z")

</div>

@Lecio_L , the presence of an array breaks your expression. To fix, place the whole JSON into an expression as below

```auto
{{
  {
    "token": $json["token"],
    . . ..
    "emails": $json["emails"],
    . . .
  }
}}

```

Note no quotes (for strings) and no “individual” curly braces. The outer expression will recognize the data type automatically.

---

<div class="post-metadata">

**Author:** ![Lecio\_L](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/lecio_l/32/42829_2.png) [@Lecio\_L](https://community.n8n.io/u/Lecio_L)\
**Post date:** [August 12, 2024, 1:32am UTC](https://community.n8n.io/t/body-json-problem-in-htttp-request/51618/4 "2024-08-12T01:32:43Z")

</div>

Thanks a lot

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [August 19, 2024, 1:32am UTC](https://community.n8n.io/t/body-json-problem-in-htttp-request/51618/5 "2024-08-19T01:32:50Z")

</div>

Closed on August 19, 2024, 1:32am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
