rest api variable substitution

soibam_ana_sing
Giga Contributor

We are facing some challenges in complex variable substitution in outbound rest API web service.   

Endpoint:  https://<ip_address>/rest/server-hardware?filter=${filter}

Method: GET

Variable substitution:  "name EQ 'SGH817YECA, bay 12' "

 

find_real_file.png

yours helps/inputs are greatly appreciated. 

 

Regards

Soibam 

 

 

15 REPLIES 15

Baala T
Mega Guru

Hi,

Variable Substitution is for testing purpose, you can change the Escape Type as 'Escape XML' which will escape single quote and send it.

While using the Rest Message in Script we have to use setStringParameter method to set the parameter value, which will does the Escape XML.

 

Regards,
Bala T

simonbergstedt
Tera Guru

What is the problem you are facing? If you test the rest message, does it not substitute the variable correctly? Might want to try to and use "Escape XML" in the "Escape Type" setting on the variable substitution.

 

This is only for test though, once you want to use it for real you need to have a look at "Preview script usage" to see how to use it in a business rule, or wherever you want to use it

Tried with "Escape XML" in the Escape Type but it same issues.. The variable is substituted correctly but its throws invalid query ..  

find_real_file.png

Harsh Vardhan
Giga Patron

the query you have mentioned in variable substitution is not valid. can you confirm how does that variable value looks like when you try to filter the record manually from that application .

 

did you try with adding only one value not the complete filter. break the query part one by one so that you can identify exact which line is breaking here