How to use placeholder definitions

I’m confused with the {placeholder} usage inside the HTTP request tool when the body of the post request is in JSON with nested properties, like so:

It doesn’t seem to work. I recevied this error message:
Could not replace placeholders in body: Unexpected token 'J', ..." { "raw": Join us on"... is not valid JSON

Information on your n8n setup

  • n8n version: 1.76.1
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Linux

Hey @Anthony_Brebion

Placeholders are not strictly strings and can be numbers, objects etc. Hence, n8n won’t automatically wrap them in quotes if you want to use them in your json body.

Try wrapping each placeholder in quotes, like this:

{
  "type": "{type}",
  "title": "{title}",
  ...
}
```.
1 Like

Hi, thank you for the tip.

1 Like

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