Haystack read op error


Hi, trying to use the Kodaro driver as Haystack API endpoint. So far the about op works fine however the read op is returning an error

ver:"3.0" dis:"org.projecthaystack.ParseException: Unexpected token: eof [line 1]" errTrace:"org.projecthaystack.ParseException: Unexpected token: eof [line 1]\n  at org.projecthaystack.io.HZincReader.err(HZincReader.java:391)\n  at org.projecthaystack.io.HZincReader.err(HZincReader.java:390)\n  at org.projecthaystack.io.HZincReader.parseVal(HZincReader.java:172)\n  at org.projecthaystack.io.HZincReader.readVal(HZincReader.java:78)\n  at org.projecthaystack.io.HZincReader.readGrid(HZincReader.java:92)\n  at com.kodaro.haystack.device.ops.BHaystackReadOp.read(BHaystackReadOp.java:100)\n  at com.kodaro.haystack.device.ops.BHaystackReadOp.op(BHaystackReadOp.java:77)\n  at com.kodaro.haystack.device.ops.BHaystackDeviceOps.asyncOp(BHaystackDeviceOps.java:513)\n  at com.kodaro.haystack.device.ops.BHaystackDeviceOps.access$000(BHaystackDeviceOps.java:27)\n  at com.kodaro.haystack.device.ops.BHaystackDeviceOps$HaystackWebOp.run(BHaystackDeviceOps.java:652)\n  at javax.baja.util.ThreadPoolWorker$WorkerThread.run(ThreadPoolWorker.java:279)\n" err

I note that the docs mention to use NEQL format for the filter but there is no examples that I could find of how this would look. Could you please assist on whether this is an issue with my filter format or something else?



The first thing to note is that you are attempting to supply a filter in the query string of the URL which is not haystack compliant. You will need to supply this as per the official haystack documenation and use zinc format in the body of the request. https://project-haystack.org/doc/Ops#read

The easiest way to test out filters before sending them through the haystack driver is to verify them via workbench in the station you are connecting to, assuming this connection type is available.

The use of NEQL syntax and examples can be found in the official Niagara documentation. If you open NIagara’s help, press ctrl+L and paste the following link in, it will take you to this section. You can also search for NEQL to find more information concerning NEQL and its usage.


Using the example you provided, you can test within workbench to see what the driver would return by running the same query:

You can see that this NEQL filter would give you nothing because it is not technically a valid query as the tag has not defined its dictionary.

So if we add the dictionary to that query, we will get back results now.

And then if we were to encode that via the haystack specifications, it would then look like:



thanks I got this working with POST requests. Though the nHaystack driver does support GET and it is in the docs here https://project-haystack.org/doc/Rest#getRequests thus the confusion


Hi Jonathan

Can I get some help please?

I have tried GET and POST and body as below

got the same error message as Raj using below

got empty results from below

The only difference is https



How are you testing this request? Do you have a valid authToken in your authorization header? Are you getting an http 200 response code? If not, what code are you getting?

If you are using https, you will need to trust the requester. This can be done by in the platformServices in the station in the certificate manager section.