Skip to content

2. API Documentation

Andy Frank edited this page Aug 31, 2024 · 4 revisions

As Jasper is a JSON-based REST API, any client may make requests to a Jasper-enabled Niagara instance.

Authentication

Jasper uses HTTP Basic Authentication. As this passes the credentials over the wire in plain text, it's strongly recommended that you only use TLS when connecting to Niagara with Jasper.

API Sessions

Each request that includes an HTTP Authorization header will create a new user session inside the Niagara web server (and associated audit log record). To avoid this for repeated requests, you can capture the session cookie returned by the initial login, and use this instead of passing the credentials:

// pseudocode to create session
req1 := WebReq("https://192.168.1.15:443/v1/about")
req1.setBasicAuth(username, password)
res1 := req1.send
session := res1.cookie.find |c| { c.name == "JSESSIONID" }

// pseudocode to reuse session
req2 := WebReq("https://192.168.1.15:443/v1/about")
req2.addCookie(session)
res2 := req2.send

Supported Endpoints

Jasper-N4 supports all standard endpoints in the Jasper specification:

✅ /jasper/v1/about   - Get information about this system
✅ /jasper/v1/sources - Get point sources from this system
✅ /jasper/v1/points  - Get point information for a source
✅ /jasper/v1/values  - Get current value data from points
✅ /jasper/v1/batch   - Invoke multiple operations in single request

Jasper-N4 does not currently support discovery.

Clone this wiki locally