Share feedback, ideas and get community help

Updated 12 months ago

How to pass var body params to http webhook

At a glance

The community member is trying to pass variable parameters into an HTTP PUT webhook body, but is encountering a syntax error. The community member's custom body is {"id":{{group_id}},"newName":{{novo_nome_grupo}}}, where group_id is [email protected] and novo_nome_grupo is test. The error message indicates an "Unexpected token @ in JSON at position 24".

In the comments, another community member suggests that the issue is that the community member is missing quotes around the variable parameters, and provides the corrected JSON body as {"id": "{{group_id}}","newName": "{{novo_nome_grupo}}"}.

Hi, I need to pass var params into http put webhook body.
My content-type is application/json
My custom body is:
{ "id":{{group_id}}, "newName":{{novo_nome_grupo}} }
where 'group_id' is a var: 120363146612174483@g.us
and 'novo_nome_grupo' is a var: test.

I am getting the next error on my back:
24/01/2024 10:52:16 Unexpected token @ in JSON at position 24 - SyntaxError: Unexpected token @ in JSON at position 24 at JSON.parse (<anonymous>) at parse (F:\Programas\vuejs\izing.open.io\backend\node_modules\body-parser\lib\types\json.js:89:19)

What am I doing wrong?
V
1 comment
You're missing the quotes.
Plain Text
{
"id": "{{group_id}}",
"newName": "{{novo_nome_grupo}}"
}
Add a reply
Sign up and join the conversation on Discord