Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to escape double quotes(") in rest endpoint url for OutBound rest message? %22 is not working.

Akshatha Ballal
Tera Expert

Hi,

I use " in my rest end point url for a get query to Nlyte and I am unable to escape it using %22. Please refer the url below and let me know where I'm doing it wrong.

http://IP-Address/nlyte/integration/api/odata/AssetsAndHosts?$filter=((SerialNumber%20ne%20%22%22)&(SerialNumber%20ne%20null))&$select=AssetName,AssetNumber,

What I want to achieve is (SerialNukber ne "" & SerialNumber ne null)

Using %20 (SerialNumber%20ne%20null) for space encoding is working fine

http://IP-Address/nlyte/integration/api/odata/AssetsAndHosts?$filter=((SerialNumber%20ne%20%22%22)&(SerialNumber%20ne%20null))&$select=AssetName,AssetNumber,SerialNumber

Error message:

{

  "error":{

    "code":"","message":"The request is invalid.","innererror":{

      "message":"An error has occurred, please verify parameter values and try again.For detailed information please contact system administrator or check server logs.\nInternal Error Message: Syntax error: character '\"' is not valid at position 18 in '((SerialNumber ne \"\")'.","type":"","stacktrace":""

    }

  }

}

 

Regards,

Akshatha

12 REPLIES 12

hammad ul aziz2
Mega Guru

try adding &quot where you want to add double quotes.

Did not work, gave the same error when %22 was used.

Can you provide the syntax if you have

Jagadeesh1
Kilo Guru

Hi Akshatha,

      I have a similar end point where I have to add quotes after $filter query. Is there a work around for the issue?

 

Thanks and Regards,

Jagadeesh

Jagadeesh...Did you get the solution for this issue ? as I am facing the same issue now.

 

If yes, can you share the syntax ?