Using /api/query yields "Requested resource does not exist."

I’m using v9.2.0.363 of IBM Endpoint Manager.

Today, I wrote a small piece of Session Relevance:

(values of it) of results from (BES computers whose (name of it = "PO121200002")) of BES Properties whose (name of source analysis of it = "[IDA/ITRIS] Master Version")

This yields actual results when I run these through the BigFix Session Relevance Tester. However, I’m trying to use this by running it through the REST API. The URL would look like this:

api/query?relevance=(values of it) of results from (BES computers whose (name of it = "PO121200002")) of BES Properties whose (name of source analysis of it = "[IDA/ITRIS] Master Version")

However, running this through the API returns “Requested resource does not exist.”.

Executing another piece of relevance (e.g. (id of it, name of it) of BES Sites) yields perfect results and gives me zero problems.

Any ideas as to what may be the problem? Are there any restrictions as to how I can use the Query action?

Can you post your exact query request and response?

It looks like there may be a problem with URL encoding. You should run the relevance statement through a URL encoder (e.g. http://meyerweb.com/eric/tools/dencoder/ or ideally using whatever language you’re writing the script it).

I’m having a similar issue, but with quotes in the session relevance requery (running 9.2.3.60)

curl -u uname:passwd -k --data-urlencode 'relevance=names of bes computers whose (name of it as string as lowercase starts with "c"' https://url:52311/api/query

result is :

<?xml version="1.0" encoding="UTF-8"?>
<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
        <Query Resource="names of bes computers whose (name of it as string as lowercase starts with &quot;c&quot;">
                <Result></Result>
                <Error>This expression could not be parsed.</Error>
        </Query>
</BESAPI>

The relevance query appears to be missing the closing parenthesis for the whose

ah, good catch. that was the issue it wasn’t working. the xml response of “”" was making me think it was in error too, but the missing “)” was the cause. thanks

<?xml version="1.0" encoding="UTF-8"?>
<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
        <Query Resource="number of bes computers whose (name of it as lowercase contains &quot;c&quot;)">
                <Result>
                        <Answer type="integer">1420</Answer>
                </Result>
                <Evaluation>
                        <Time>9.845ms</Time>
                        <Plurality>Singular</Plurality>
                </Evaluation>
        </Query>
</BESAPI>