Bigfix query issue

I am passing this query and not able to get the operating system as an output.

https://host:52311/api/clientquery

body

<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
<ClientQuery Resource="https://host:52311/api/clientquery/2391">
<ApplicabilityRelevance>true</ApplicabilityRelevance>
<QueryText>name of operating system</QueryText>
<Target>
<ComputerID>{computerid}</ComputerID>
</Target>
</ClientQuery>
</BESAPI>

could you please help.

You can’t just use {computerid} as the Target value. You need an actual, computer id value there (the number).

You could obtain the computer id value to use in one API call, and then use that to build the xml value for a second call to clientquery.

you can’t just pass the computer name. Name is easy instead of computerID if you 1000’s of computers.