Thanks @trn, we are getting closer but its giving me extra %2522 , desired output be “text %22” but with my relevance I am getting "text ", however after adding %25 getting “Text %2522”,
As of now, yes but once its done I will be mapping this into action script to fill up info under one parameter & than, parameter values will be pasted into cURL based API query.
After adding %2522, although its showing %2522 but when its being used during API call its getting converted into %22 not as quotes due to that query is failing. so if I somehow able to manage or print only %22 at 1st place my query will work.
Below output is from output.xml file if %2522 is being passed-
<Query Resource="ids of bes computers whose ((rope %22,%22 & rope %22,Server1%22 & rope %22,Server2%22 & rope %22,Server3%22 & rope %22,Server4%22 & rope %22,Server5%22 & rope %22,%22) contains (%22,%22& name of it as lowercase &%22,%22))">
<Result></Result>
<Error>This expression contained a character which is not allowed.</Error>
Below output is when only %22 is being passed -
<Query Resource="ids of bes computers whose ((rope "," & rope ",Server1" & rope ",Server2" & rope ",Server3" & rope ",Server4" & rope ",Server5" & rope ",") contains (","& name of it as lowercase &","))">
<Result>
<Answer type="integer">4267590</Answer>
<Answer type="integer">6346207</Answer>
It seems to be an effect of going through multiple levels of encoding – both URL-encoding and Relevance encoding; depending on your REST client you may have the tool itself perform some url-encoding for you, such as the --data-urlencode option on Curl.
From @brolly33’s posting (which will not ‘quote’ properly here, because…some of it gets percent-encoded ). Note the use of %252522. URL-decoding represents that as %2522 and then Relevance decoding represents as %22, the " symbol.
Because of the decoding happening in multiple steps, you need to percent encode the percent to get around this.
session relevance
"%22"
rest query
https://brollytest:52311/api/query?relevance=(%22%252522%22)
on the first decode pass,
the outer %22 turns into "
the outer %25 turns into %
Then on the second decode pass you effectively have "%2522" which converts to a "%22" and finally to a """
but the problem is my relevance query is not getting resolved properly using %2522.
relevance="ids of bes computers whose ((rope %2522,%2522 & rope %2522,Server1%2522 & rope %2522,Server2%2522 & rope %2522,Server3%2522 & rope %2522,Server4%2522 & rope %2522,5%2522 & rope %2522,%2522) contains (%2522,%2522 & name of it as lowercase & %2522,%2522))"
Query output -
<Query Resource="ids of bes computers whose ((rope %22,%22 & rope %22,Server1%22 & rope %22,Server2%22 & rope %22,Server3%22 & rope %22,Server4%22 & rope %22,Server5%22 & rope %22,%22) contains (%22,%22& name of it as lowercase &%22,%22))">
<Result></Result>
<Error>This expression contained a character which is not allowed.</Error>
In pure relevance "%22" >> """
In most API calls single wrap "%2522" >> "%22" >> """
in API to Query you have to double wrap "%252522" >> "%2522" >> "%22" >> """
Try:
relevance="ids of bes computers whose ((rope %252522,%252522 & rope %252522,Server1%252522 & rope %252522,Server2%252522 & rope %252522,Server3%252522 & rope %252522,Server4%252522 & rope %252522,5%252522 & rope %252522,%252522) contains (%252522,%252522 & name of it as lowercase & %252522,%252522))"