Page 1 of 1

Using parameters in a Request Body

Posted: Tue Feb 22, 2022 6:10 pm
by thegamechanger

Hi Guys,

For the API I am calling, I need to include a Body Request to to do a find in the service. If I hard code the value, it works fine: e.g.

{
"query":[
{"Email": "==email@domain.com"}]
}

But if I try to use the "email" parameter I am passing into the call I keep getting errors ("Unexpected token P in JSON at position 33") :

{
"query":[
{"Email": PARAMS.QUERY.email}]
}

I am sure it is my syntax, but I can't figure it out.

PLLEEAASSE HELP!


Re: Using parameters in a Request Body

Posted: Wed Feb 23, 2022 2:32 pm
by Serhii Kulibaba

Hello,

Where exactly do you pass these values to the body?
In your API Express service, REST component?

Could you please provide us with more details, screenshots or exact steps to reproduce this problem?


Re: Using parameters in a Request Body

Posted: Sun Apr 24, 2022 4:25 pm
by blackopzfx

are you SURE you're passing the 'exact' string'? You should do a console.log on "PARAMS.QUERY.email" to verify that it matches what you're expecting. If it works hard-coded then you're most likely not matching that request.