Haystack REST APIs

Haystack REST APIs

The Haystack REST API documentation along with Ops and Authentication can be found here:

https://project-haystack.org/doc/docHaystack/HttpApi

https://project-haystack.org/doc/docHaystack/Auth

https://project-haystack.org/doc/docHaystack/Ops

Note: In order to use the eval op, you must enable the “Allow get with side effects” setting in your Host → Settings under the API section, or apply the https://haxall.io/doc/lib-ph/noSideEffects tag if using functions or operations.

You can try end point:  http://host/api/<projName>/read?filter=<axon filter>

Example to read about: http://host/api/<projName>/about

Example to read all operations allowed: http://host/api/<projName>/ops

Example to read all points in the database: http://host/api/<projName>/read?filter=point

Example to read all alarms in the database: http://host/api/<projName>/eval?expr=readAll(equip or point).alarms(today)

Example to read a single point history in the database: http://host/api/<projName>/hisRead?id=@p:demo:r:1eeaff9e-a14e5d23&range=today

Example to batch read history of multiple points. This requires POST request with a Zinc or JSON body, like this:

Zinc example:

ver:"3.0" range:"today" id @p:demo:r:1eeaff9e-a14e5d23 @p:demo:r:2bbaff9e-b24e5d34

JSON example:

{   "meta": { "ver": "3.0", "range": "today" },   "cols": [{ "name": "id" }],   "rows": [     ["@p:demo:r:1eeaff9e-a14e5d23"],     ["@p:demo:r:2bbaff9e-b24e5d34"]   ] }