thegamechanger
Posts: 2
Joined: Tue Feb 22, 2022 5:59 pm

Using parameters in a Request Body

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!

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Re: Using parameters in a Request Body

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?

blackopzfx
Posts: 2
Joined: Sun Apr 24, 2022 4:12 pm

Re: Using parameters in a Request Body

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.

Return to “Issues”