I am using the REST API to collect various information about the clients in an ILMT environment. E.g. there is no problem to get the “Scanner Version” value from the analysis “Scanner Information”. But when I try a to get any property from “Excluded Directories” analysis I do not get what I want.
What I really want is the excluded directories, but since that did not work I tried the more simpler property “Operating System”, but gets the same result. The call to cUrl looks like this:
curl -X GET $USER -sk $URL/api/query?relevance="((values+of+it,id+of+computer+of+it)+of+results+of+it,+names+of+it)+of+property+whose+(name+of+it+is+%22Operating%20System%22)+of+bes+analysis+whose+(name+of+it+is+22Excluded%20Directories%22)"
The result back is:
<Query Resource="((values of it, id of computer of it) of results of it, names of it) of property whose (name of it is "Operating System") of bes analysis whose (name of it is "Excluded Directories")">
<Result></Result>
<Evaluation>
<Time>46.129ms</Time>
<Plurality>Plural</Plurality>
</Evaluation>
</Query>
Sorry, but that returns exactly the same result (after quoting the relevance).
Since a query for “Scanner Version” (%22Scanner%20Version%22) in “Scanner Information” (%22Scanner%20Information%22) works fine, as well as others, I do not suspect the url to be the problem.
That was a copy paste mistake of me when I created the post. As you see from the response it says … name of it is "Excluded …, which means that it translated %22 to "
You are correct, if the % was missing in the encoded relevance, the REST API should have thrown a parsing error. I didn’t test your original typo as-is, I corrected it first and ran it in my environment, where it did return results.
However, the main reason could be, you weren’t seeing any data earlier is that the query was actually referencing the Operating System property instead of the Excluded Directories properties inside the analysis.
I updated the relevance to target the correct property, and the following version is working for me:
((id of computer of it, (if value of it as string = "" then "N/A" else value of it))) of results of bes property whose (name of it = "Excluded Directories")
My test environment was newly set up, and I forgot to activate the analysis “Exluded Directory”! After doing that everything worked as expected, with my original code. I will add checks in my script for if the analysis I am gettting information from really is activated!